Minor rotation issues?

Hello, I’m currently using C# as a scripting base and when I change the rotation of an object, this object being the basic FPS Controller. It immediately goes back to what it was originally.

public GameObject playerobj;
playerobj.transform.eulerAngles = new Vector3(0, 50, 0);

Any ideas? Thanks!

~Kind regards Lachlan.

If you are referring to Unity’s FPS controller from the Standard Assets package, the scripts used to control it are going to overwrite you changes on the next frame. The controller is designed so that the mouse position is used to drive the rotation of the object. You would need to disable the controller components that are updating the rotation to allow your change to be noticeable.

Okay, Apologies I’m not too keen on changing the default setup, could you please explain how I would do this?

That would really depend on what your actual goal is. If you could explain a bit more about what you are trying to do I can probably help more.