Collision off and on when key pressed

How do I…

So, I want to make a mechanic in the game called, “Boundary Pass”, basically, I want where if you press a key, a certain objects collision will be turned off along with all the instances of it within the scene. Is there any way to make this happen?

If anything…

I know of the action, “Collision Masks”, but it thinks there is no object.

Simply add a boolean variable in the condition where you have the collisions and active and deactive this Var when you need in other events like with a Key press or something like that

Ok, I can try that! I’ll let you know if it has worked!

Ok, I figured out the solution, I just had to use the booleen to move the collision box (which is seperate) to another unreachable x and y. Thanks!

1 Like

There’s no need to move the collision object.

Say you have a boolean named checkCollision
You set it to true or false then check the value before the collision condition. If you want to ignore several collisions then all of the events could be a sub event of a boolean check.

2 ways of doing it


If you are using physics system, you can turn masks on and off.

ok! Sorry for the late reply, I’m doing well now! Thanks!

1 Like