How to know which way the player is facing via script
by Juan Lemus · in Torque 3D Professional · 03/26/2010 (5:12 pm) · 3 replies
I was wondering if there’s a way of finding out which way my player is facing via script? The thing is that one animation in particular moves forward from the direction the player is facing. This wasn’t a problem at first since in the default T3D code the player is always facing forward so I just added the moveforward command when the animation played. But I started having problems after I installed Ubiqsoft 3D Action Adventure Kit. The problem is that the 3DAAK lets the player face other directions, not just forward. So every time I tigger the animation with the moveforward command, the animation will play in the direction the player is facing, but as soon as the moveforward command is activated, it will automatically make the player face the direction the player thinks is forward and move in that direction. So I need a way of knowing what direction the player is facing so that I can tell the player to move in that direction.
About the author
I am the chief of the team in Lion Works studio, in Guatemala , Central America.
#2
It means the input is related to the camera transform.
On the other hand ... getForwardVector() returns the player's direction in world space and I think this is not the right place to workaround the problem.
You should see how this movement is organized and apply some corrections to the c++ side.
I think you should ask Ubiqsoft about this.
03/27/2010 (10:11 am)
This kit eventually uses an 8-way directional movement.It means the input is related to the camera transform.
On the other hand ... getForwardVector() returns the player's direction in world space and I think this is not the right place to workaround the problem.
You should see how this movement is organized and apply some corrections to the c++ side.
I think you should ask Ubiqsoft about this.
#3
03/31/2010 (9:11 am)
Hi Juan, you still need those animations?
Torque Owner Guy Allard
Default Studio Name