Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Throw2 : MonoBehaviour {
  6.  
  7. public float ThrowSpeed = 50F;
  8. public Rigidbody RB;
  9.  
  10. void Start ()
  11. {
  12. RB = GetComponent<Rigidbody> ();
  13. }
  14.  
  15. void Update ()
  16. {
  17. if (Input.GetButtonDown ("Fire1")) {
  18. RB.AddForce (transform.forward * ThrowSpeed);
  19. }
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement