Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

velocity to prefab

$
0
0
Instantiating spent casing from pistol when fired that just drops to the ground. I want them to fly out to the right as casings do when ejected. Tried animating the PreFab but the position in the animation prevented the prefab from spawning where it needs to be.Have tried several different ways so I can't even be sure how much of this version of the code is just plain stupid. But as is, it does instantiate the prefab at the correct spot.I have a rigidbody on the casing. Seen similar examples online but when tried to implement get errors saying things don't exist ( examples must be leaving out stuff in the void start) public Transform clipEject; public GameObject casing; void Update () { if (Input.GetKeyUp(KeyCode.Mouse0)&& (isPaused ==false)) Instantiate(casing, clipEject.position, clipEject.rotation) ; } }

Viewing all articles
Browse latest Browse all 1264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>