- Home /
How to stop assets from colliding when they are moving around the player?
Hi everyone,
I'm very new to Unity - started using it 1.5 month ago - with tutorials both made by Unity and by users. I really hope you can help me because with this issue, I don't even know where to start.
I am working on a 2D maze game and my level 1 has 2 floors, with a teleportation feature allowing the player to go from one floor to the other one. Both my floors are in the same Scene, to avoid loading times.
For the player's movement, I followed this tutorial. It makes the maze move around the player, eg: when the user wants the player to go up, it's actually the maze moving down.
Thus I'm having the following problem: floor1 is right above floor2 in the Scene. When the player is going down in floor 1, all goes well, until it collides with a wall. At that moment, floor1 doesn't go up anymore, but floor2 keeps going up, so much that it ends up colliding with floor 1.
How can I avoid that? I was thinking of finding a way to activate the moveMaze script on floor1 or floor2 only when the player is on said floor. But I have no idea how to do that.