GE 1.5 Beta Rotation?

Non-platform specific questions.

GE 1.5 Beta Rotation?

Postby Hblade » Sat Jun 30, 2012 8:27 pm

I'm designing a space-shooter, and I was wondering how I can set rotation? Like, when you press down, I want the ship to turn down-ward at an angle, same with up. How can I set the rotation based on an angle? Example:
Code: Select all
if(angle<45)
{
angle+=(45/10); //10 frames to complete angle change
Rotate?
}
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: GE 1.5 Beta Rotation?

Postby skydereign » Sat Jun 30, 2012 8:43 pm

The function to rotate is the SetRotation function.
Code: Select all
SetRotation(angle);
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: GE 1.5 Beta Rotation?

Postby Hblade » Sat Jun 30, 2012 9:04 pm

Ahh thanks.
Problem though, Dynamic actors can't rotate with gravity set to 0 for some reason.

Edit:
Actually after testing once, this script stops working after the first time and stops mid-way through the rotation
Code: Select all
angle+=5;
SetRotation(angle);


This is easilly solved by replacing angle with a variable
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron