Guest User

Untitled

a guest
May 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Kynai : MonoBehaviour
  5. {
  6. public KeyCode weaponkey;
  7. public GameObject kynai1;
  8. public Camera camera;
  9. // Use this for initialization
  10. void Start ()
  11. {
  12. }
  13.  
  14. // Update is called once per frame
  15. void Update ()
  16. {
  17. if (Input.GetKeyDown(weaponkey))
  18. {
  19. StartCoroutine(Coroutine());
  20. Vector3 orochimarupos = kynai1.transform.position;
  21. Debug.Log("14");
  22. Transform blank = Instantiate(kynai1,transform.position, transform.rotation) as Transform;
  23. Debug.Log("16");
  24. kynai1.transform.position += Camera.mainCamera.transform.forward*40;
  25. yield return new WaitForEndOfFrame();
  26. Debug.Log("18");
  27. }
  28. }
  29. }
  30. public IEnumerator Coroutine()
  31. {
  32. kynai1.transform.position += Camera.mainCamera.transform.forward*40;
  33. }
Add Comment
Please, Sign In to add comment