Page 1 of 1

Scri[ted player to Rotate Right and Left ( Low Level)

Posted: Fri Apr 28, 2006 1:56 am
by rgdyman
Need someone to turn a light on for me please..

I have a scripted player.

He walks forward just fine.

I have a " Turn Right" command and he turns to the right just fine.

After pressing the key ,Now he's looking to the right.

But, He still walks the original direction. ( Now it's sideways) Follow me?

What do I nee to update to change his facing direction so he walks forward after turning to the right ?
I thought it wiuld be his YAW. didnt seem to work though.

Any ideas?

"All Lowlevel commands"

Thanks all,
rgdyman

Posted: Fri Apr 28, 2006 4:17 am
by shadow
How are you turning your pawn? What command are you using?

A command similar to this is usually used.

ai_face[ ()
{
   self.ideal_yaw = enemy_yaw;
   ChangeYaw(); // rotate to face enemy
} ]

So, take your self.current_yaw and add the necessary degrees (remember to convert to radians) to self.ideal_yaw.

turn_rt = self.current_yaw + (45/0.0174532925199433);

turn_right[ ()
{
   self.ideal_yaw = turn_rt;
   ChangeYaw();
} ]

Just make sure that while turning you don't keep updating turn_rt or your pawn will keep spinning in circles.

Posted: Fri Apr 28, 2006 9:24 am
by rgdyman
TY shadow.


Done.


Forgot radians.. :oops: // feeling stupid.