- Home /
change bool on collision
I have a wall gameobject and a player gameobject -- I gave the wall and the player boxcollider2d components, and to the wall I made the collider a trigger. I want the wall to detect if the player has collided with it (aka touched the boxcollider) -- and if it has, set a variable flag in the script connected to the player to true. Is this possible? I can't use gameobject.find because I have multiple players.
I'm not keen on using rigidbody since it gives me some more issues so I'd prefer if we checked the collision like this through script rather than through the inspector.
Comment
Your answer