GetAngleZ and GetPositionZ (didn't test the others) are not responding. I have a ship as an activator which has 4 other objects attached to it through AddHavokBallAndSocketConstraint and I'm moving them all through ApplyHavokImpulse. None of them respond to GetAngle and GetPosition functions. It returns the initial value correctly, where the object initially started, but all following calls keep returning the initial position and angle values.
Why? I'm sure I'm calling it correctly. Is it a bug with the constraints? And how can I overcome it???
Just in case, this is the piece of code giving me troubles:
Spoiler
Event OnKeyDown(Int KeyCode) If KeyCode == 72 ;FORWARD - Num8 AngleZ = Self.GetAngleZ() ;ControllerBuoyFront.ApplyHavokImpulse(Math.Sin(AngleZ), Math.Cos(AngleZ), 0.0, 800) ApplyHavokImpulse(Math.Sin(AngleZ), Math.Cos(GetAngleZ()), 0.0, 70) EndIf If KeyCode == 80 ;BRAKE - Num2 AngleZ = Self.GetAngleZ() ApplyHavokImpulse(Math.Sin(AngleZ), Math.Cos(AngleZ), 0.0, -70) EndIf If KeyCode == 75 ;RIGHT - Num4 AngleZ = Self.GetAngleZ() + 90 ControllerBuoyBack.ApplyHavokImpulse(Math.Sin(AngleZ), Math.Cos(AngleZ), 0.0, 100) EndIf If KeyCode == 77 ;LEFT - Num6 AngleZ = Self.GetAngleZ() - 90 ControllerBuoyBack.ApplyHavokImpulse(Math.Sin(AngleZ), Math.Cos(AngleZ), 0.0, 100) EndIfEndEvent
The impulses are working. Only the GetAngle part isn't. The forward key is always moving the ship in the same direction, regardless of it's angle...