- Home /
M2H auth example moveDirection
Hi,
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.
Answer by Peter G · Jun 30, 2010 at 12:44 AM
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.
Your answer
![](https://koobas.hobune.stream/wayback/20220613063449im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
EndOfStreamException: Failed to read past end of stream. 0 Answers
Best way to serialize a ScriptableObject reference using NetworkWriter/Reader 1 Answer
How to serialize an object to a byte array 1 Answer
Photon (PUN) Type Serialization Error on RPC 2 Answers
UNet Network Behevior On DeSerialization/Serialization Help 1 Answer