Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class BallFall : MonoBehaviour
  5. {
  6.     public GameObject projectile;
  7.  
  8.     void Update()
  9.     {
  10.  
  11.         if (Input.GetButton("Fire1"))
  12.         {
  13.             GameObject clone;
  14.             Instantiate(projectile, transform.position, transform.rotation);
  15.             clone = projectile;
  16.             clone.rigidbody.velocity = transform.TransformDirection(Vector3.forward * 10);
  17.         }
  18.  
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement