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

Rigidbody2d.AddForce behaving odd

$
0
0
I have a ship that shoots a laser. I use something like GameObject laserClone = Instantiate(laser,transform.position+(transform.up),transform.rotation)as GameObject; laserClone.rigidbody2D.AddForce(transform.up* speed*Time.deltaTime); I attached another script to the laser prefab to print the velocity.magnitude after 1/4 of a second. I have the speed set so that the velocity's magnitude is about 16. Most of the laser clones are within 0.01 of each other but occasionally and randomly some will have a velocity of 1-3. I cannot figure out why. If anyone else has experienced something similar r has any idea what could be causing this any help would be appreciated. Thanks.

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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