M2H auth example moveDirection


I'm trying to alter the player script used in Leepo's example for serialization. (tutorial 3) I want to integrate :

transform.eulerAngles.y += Input.GetAxis("Horizontal") * 5;

or another way so that my player turns instead of moving (strafing) to the right. Any help would be nice :) Eddy.

I have always found this way a good:

transform.Rotate(0, Input.GetAxis("Horizontal") * 5 * Time.deltaTime, 0);

It is pretty much self explanatory. I haven't seen the Leepo tutorial, so I don't know what it invovles. This rotates the object 5 degrees a second times the horizontal axis value around the y axis, which normally goes through the player vertically.