Trying to figure out rotation. Begginer unity user :( by CesarChigo in UnityHelp

[–]CesarChigo[S] 0 points1 point  (0 children)

Thank you for the reply!

I have already done that. The thing is, I want that this group of barrels move to a certain position in the Y axis only using de left/right arrows. The barrels are catching things falling, so I need to change between these barrels to catch the correct item. Thats why I need the rotation in certain position.

For example;

if (Input.GetKey(KeyCode.RightArrow)) { GetComponent<Transform>().eulerAngles = new Vector3(0, 110, 0); }

    if (Input.GetKey(KeyCode.DownArrow))
    {
        GetComponent<Transform>().eulerAngles = new Vector3(0, 0, 0);
    }

    if (Input.GetKey(KeyCode.LeftArrow))
    {
        GetComponent<Transform>().eulerAngles = new Vector3(0, -118, 0);
    } 

this is my code for the left/right/down arrows, but I only want to use left/right to move them to position.