|
FAQ
• Search • Login
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Author |
Message |
Areku
Joined: Fri Oct 17, 2008 9:46 pm Posts: 5212 Location: The Grills Locker.
|
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.
|
Mon Jun 08, 2009 2:10 am |
|
|
Daman
Joined: Fri Jan 26, 2007 3:22 am Posts: 1451
|
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.
|
Mon Jun 08, 2009 3:07 am |
|
|
AaronLee
Joined: Fri Jun 01, 2007 12:17 am Posts: 106
|
Re: Rotation issues
Code: self.angularVel = 0; done
|
Mon Jun 08, 2009 6:05 pm |
|
|
Areku
Joined: Fri Oct 17, 2008 9:46 pm Posts: 5212 Location: The Grills Locker.
|
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.
|
Tue Jun 09, 2009 11:44 pm |
|
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|