Data Realms Fan Forums
http://45.55.195.193/

Rotation issues
http://45.55.195.193/viewtopic.php?f=73&t=15250
Page 1 of 1

Author:  Areku [ Mon Jun 08, 2009 2:10 am ]
Post subject:  Rotation issues

Another very basic piece of code I'm making, this time for an ACRocket, uses a rotation variable. To put it simply, it's:


if self.RotAngle ~= 0 then
self.RotAngle = 0 ;
end

It works perfectly as it should, keeping the ship balanced, but there is a small problem. If the rocket receives an impact strong enough to change its rotation faster than the script can correct it, the sprite stays upright, but all of the ship's parts, such as thrusters, legs and exits, stay stuck in a weird-looking angle. Apparently, the only way to fix it is slamming the rocket on the terrain, as that seems to force the dislodged parts back to their original places. Does anyone know a workaround solution for this issue? Thanks in advance.

Author:  Daman [ Mon Jun 08, 2009 3:07 am ]
Post subject:  Re: Rotation issues

Check if using addforce on it after it's glitched like that repairs it. If so you could addforce it by an extremely weak amount when correcting the RotAngle.

Author:  AaronLee [ Mon Jun 08, 2009 6:05 pm ]
Post subject:  Re: Rotation issues

Code:
self.angularVel = 0;


done

Author:  Areku [ Tue Jun 09, 2009 11:44 pm ]
Post subject:  Re: Rotation issues

Hmm. I tried both methods, but neither of them worked.

I managed to find an alternate solution, though. Changing the rocket's feet and thrusters position to one near the center of the sprite makes them harder to hit with terrain, making the bug happen much less often.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/