I dont know how to make an invisible box, where the player walks through one way, but if they turn around, they cant walk back. I dont know if this is a coding thing, or if theres a functionality in unity for it.
Any help is appreciated! THANKS!
I’d imagine you’d have to use a trigger collider for this… (primer if you’re not familiar: 3D Physics - Unity Learn )
how are you handling movement at the moment?
edit: handy for checking if two vectors are in the same direction: Unity - Scripting API: Vector3.Dot
Interesting Vector3.Dot.
Another option is to use an empty gameobject with two colliders. Collider 1 is off and collider 2 is a trigger. When a person enters collider 2, collider 1 is turned on, which is a normal collider and doesn’t allow moving through it(so it’s not a trigger).
I like this solution, thanks for the advise.
I realise this has already been answered, but what I do is create a plane, give it a transparent shader, and rotate it so it stands up like a wall. When you’re placing it, the side with the grid is the one you can’t walk through. I don’t think any colliders are needed for this.