Access Violation using SetPosition

iso8859-1

13-05-2008 11:48:32

Hi,

sometimes I get an access violation when I use Node.SetPosition() or Node.Position.


void _ac_OnPosition(object sender, ACEventArgs e)
{
float neuY = (float)_ac.Position;
neuY *= 10;
neuY += (float) hFlasche;
float x = _hook.Position.x;
float z = _hook.Position.z;

//Positionierung y
_hook.Position=new Vector3(x, neuY, z); //Access violation here

//Skalierung des Seils
Vector3 scaleRope= new Vector3();
scaleRope.y = (float)(_gridHeight - neuY);
_rope.SetScale(1.0f, scaleRope.y, 1.0f);
}


The code is for animating a rope with some hook attached to it. The rope is a child of the hook. The position of the hook is calcualted and then the rope is scaled accordingly.
The method is called by an event. The event is raised whenever a new position of the hook is received via network. It also seems that the violation only occurs if I generate more than ~40 entities attached to the same event-throwing object.

Can someone give me a hint what the error is?