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.
↧