What is the best way to script a trigger that moves a object from point a to point b in C# (unity 5)

Hi! I am a beginner and looked over all the forums. I tried a lot of stuff too but it did not work out :frowning: . I am building a maze right now. I only got the grid. So I want a trigger that let a wall fall down when a player walks true it. (from point A in the sky to point B on the ground in the maze). So I was wondering if somebody can explain and help me with this.

Please help me !!!

  1. Create a new gameObject

  2. Add Box collider

  3. Adjust Box collider

  4. Make the box collider a trigger by ticking “is Trigger”

  5. Add script to gameObject

  6. In that script, add:

            public GameObject objectToMove;
         public Vector3 moveDirection;
         
         void OnTriggerEnter (Collider other) [
              objectToMove.transform.position =+ moveDirection;
         }
    
  7. Save and Compile!

Change the movement code as necessary. Hope this helps @R3dpyro

Fydar.