I need an object to touch another object in an if statement. Thanks

  • Assuming there's area2D's for both(actually just an area 2D for water should be enough) the player and the 'water' it should be easy via area entered/exited signal. For the sake of your if statement, if signal is not enough you can toggle a boolean variable via the signals and use the boolean state in that if statement.

Shows some code/pseudo code or at least try and paint us a picture in words of just what you are trying to use this for. Whats the actual problem you are trying to solve here?

So we could try and give you the best answer we can.

    The documentation has examples of how to do collision detection in 2 and 3D, are these not helpful ?

    Megalomaniak

    i need to see if the player is touching water

    i don't care how this is achieved

    thanks

    Assuming there's area2D's for both(actually just an area 2D for water should be enough) the player and the 'water' it should be easy via area entered/exited signal. For the sake of your if statement, if signal is not enough you can toggle a boolean variable via the signals and use the boolean state in that if statement.