Advertisement
AndrewRosyaev

Untitled

May 15th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. t += Time.deltaTime;
  2. float vz = Speed*t* Mathf.Cos (Angle2) * Time.deltaTime;
  3. float vy = Speed*t* Mathf.Sin (Angle)* Time.deltaTime-(9.8f*Mass*(t*t))/2* Time.deltaTime;
  4.  
  5.  
  6. Vector3 NextPos = new Vector3 (transform.localPosition.x, transform.localPosition.y + vy, transform.localPosition.z + vz);
  7. transform.rotation = Quaternion.LookRotation(transform.localPosition-NextPos);
  8. transform.localEulerAngles += new Vector3(0,transform.parent.eulerAngles.y,0);
  9. transform.localPosition = NextPos;
  10.  
  11.  
  12.  
  13. RaycastHit hit;
  14. if (Physics.Linecast(LastPos, transform.position, out hit))
  15. {
  16. Destroy (transform.parent.gameObject);
  17. }
  18.  
  19. LastPos = transform.position;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement