How do I make the player turn?

I joined today and started making a test. I got the player to move when you press WASD but can’t figure out how to make him turn. Sorry for the stupid question… :expressionless:

Here’s a link to the code: https://playcanvas.com/editor/code/687528?tabs=31025902

P.S mova is the code for the player. and mova2 is for the light.

Hi @Click_Point and welcome!

You can turn left and right using a similar function:

this.entity.rotateLocal(0, 3 * dt, 0);

Multiplying with dt ensures that the movement is smooth, whatever the FPS the app is running on.

1 Like

Thank you! :slight_smile:

1 Like