Ignoring Collision by pressing a button

Hello,

i am currently working on a 2d side scroller and i asked myself what is the best practice to drop from a box if i am pressing the down-button for example.

e.G.:
I am standing on a box with my character and can run on top of it. If i am pressing a button i want to drop down and land on the ground and move in front of the box, but if i am jumping i want the collision re-enabled to stand on the box.

sry for my bad english and thx for your help!

You would disable the collision on the object that you are currently standing on when they press down. Obviously put checks in place to make sure that it is a box and not the normal walking area.

For jumping you would reverse the process, but you would have to do some fancy spatial checking to activate collisions on all boxes around you.

This is a very simplified explanation of what you need to do. Can’t think of the correct node right now … not in front of my dev machine … sorry.

thank you, this is helping me! :slight_smile: