Remove some part of collision if behind wall

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By manushifva

Is it possible to remove some part of collision if it’s behind a tilemap wall with collision?

not sure what you want to do exactly, but you can shrink the collider in code when a collision happens,
if you’re using a kinematicBody2d for example check collision by calling get_slide_count after move_and_slide to get how many objects you collided with and then in a loop check for get_slide_collision, this should get you information about all bodies you collided with plus aditional info like position which you can use to determin the exact point of collision and shrink the collision shape accordingly

check out: get_slide_count and KinematicCollision2D in the docs

Xx Void xX | 2021-10-02 15:45