[Solved] Body's Velocity == NaN?

Jun 7, 2011 at 7:08 PM
Edited Jun 7, 2011 at 7:17 PM

i allways get an error at ContactSolver -> InitializeVelocityConstraints because it says that Vector2 vB = bodyB.LinearVelocity; is Vector2(float.NaN,float.NaN) and this causes a crash.

i'm using FPE 3.2 and i DO edit the bodys velocity and rotation becuase adding force doesn't work that good with an scale for the physics (if scale = 10 adding a force of 10/scale is weaker as with scale =100...)

does editing the velocity causes the error? (only do things like velocity += new Vector2(10,0))

if yes can someone say me how i can fix the problem with the force and physics scale?

 

EDIT: removet the velocity+= things and replaced them with add force but the error still appers

i only use circles and it happens when 3 or more circles and when the force applyed to them is facting the center of the 3 circles

Jun 8, 2011 at 12:56 PM

ok i found out what caused this error.

my shoot at formula was not error save... when shooting at a moving object with higher velocity that the max bullet speed an error appered and the velocity got NaN

fixed it