Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class BallFall : MonoBehaviour
- {
- public GameObject projectile;
- void Update()
- {
- if (Input.GetButton("Fire1"))
- {
- GameObject clone;
- Instantiate(projectile, transform.position, transform.rotation);
- clone = projectile;
- clone.rigidbody.velocity = transform.TransformDirection(Vector3.forward * 10);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement