Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
434 B
13
Indexable
Never
private bool Rotating = true;
    void Start()
    {}

    // Update is called once per frame
    void Update()
    {if (Input.GetKeyDown(KeyCode.Z))
        if (Rotating == true)
            {transform.Rotate(0, 0, 90);}
    if (Input.GetKeyDown(KeyCode.X))
        if (Rotating == true)
            {transform.Rotate(0, 0, -90);}}
    private void OnTriggerEnter2D (Collider2D collider)
        {Rotating = false;}
}
Leave a Comment