Strafing

For a couple of hours (distracted), I have been trying to get the player’s animation to change without changing the model when he strafe’s, but this is becoming a problem. Currently, the players rotation is controlled by the camera, otherwise I would simply self.player.setH(). Anyone have any thoughts about how I could accomplice this? How can I just instantly rotate the players running model/animation when I press the button, but also have total 360 rotation with the camera (the buttons will only rotate him 8 directions).

I don’t want to just change the model because this is just an easy work around, but if no other solution can be found, I’ll just do it.

You can parent the camera and the player model to an invisible “dummy” node instead of parenting the camera directly to the player model.

When you want to move the player you move this dummy node so the model and the camera move with it.

When you only want to rotate the player model apply the rotation to the model only and the camera remains fixed.

You could also probably achieve similar behavior with a compass effect.

Yes, this is what I’m doing, but the problem is, the player’s direction is also determined by the mouse. Think WoW movement. So when I try to rotate the player, nothing happens. This is definitely because of it already being controlled by the mouse, because I’ve done the same thing with the Roaming Ralph tutorial except I didn’t have camera control with the mouse.

The problem isn’t the camera moving when I don’t want it to, but the player not rotating when I want him to.

Edit: It seems to be impossible using this specific control scheme. I decided that I would simply change the models. However, thank you very much for your input.

Edit: Currently working on changing it so that it will work. Wow, too much of a pain to have to load the models.

Edit: Found a solution. Realized that I should only have Ralph follow the camera when the right mouse button is pressed. Duh. Went through a bit to get this to work. I will try to post the code once it is finished and cleaned up.