How can I change a scene by the rotation z position?,

Hello Everyone!
I’m developing a game that has a key, and when I rotate it, it should open the door.
I know that it is a pretty noob question, but I’m really stuck with the syntaxes. Here is my code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class GameManager : MonoBehaviour
{

    public GameObject gameobject1;
    private void update()
    {
        if (gameobject1 == rotation.position.z)
        {
            SceneManager.LoadScene("Win");
        }
    }
}

,

Hi @sergio_gn,

I would change (gameobject1 = rotation.position.z) to (gameobject1.transform.rotation.z == ). Put whatever value you want into the "" to check if gameobject1 has rotated. Transform tells Unity that you are going effect a gameObjects rotation, position, or scale. I hope this helps.,Hi @sergio_gn,

I would change (gameobject1 == rotation.position.z) to (gameobject1.transform.rotation.z == _). Put whatever value you want in the "" to check if “gameobject1” has rotated. Transform tells Unity that you are going to effect a gameObject’s position, rotation, or scale. I hope that this helps you.