View unanswered posts | View active topics It is currently Fri Jan 10, 2025 10:23 pm



Reply to topic  [ 4 posts ] 
 Rotation issues 
Author Message
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post 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
Profile
User avatar

Joined: Fri Jun 01, 2007 12:17 am
Posts: 106
Reply with quote
Post Re: Rotation issues
Code:
self.angularVel = 0;


done


Mon Jun 08, 2009 6:05 pm
Profile WWW
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post 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
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.046s | 15 Queries | GZIP : Off ]