UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"open and close door on button click"
public class OpenAndCloseDoorOnButtonClick : MonoBehaviour { private float xScale; private void Start() { xScale = 1f; } public void OpenAndCloseDoor() { xScale *= -1f; transform.localScale = new Vector3(xScale, 1f, 1f); } }