Could someone help me with it’s i would like to move a wall when the player is in the right trigger and press a key
this is what i have now:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Secret : MonoBehaviour
{
public GameObject Wall;
public AudioSource WallFX;
void OnTriggerStay(Collider other)
{
if (other.tag == "Wall")
{
if (Input.GetButtonDown("Interaction"))
{
WallFX.Play();
Wall.GetComponent<Animator>().Play("secretroom");
this.GetComponent<BoxCollider>().enabled = false;
}
}
}
}