#void ontriggerenter2d just... doesnt work

1 messages · Page 1 of 1 (latest)

opaque gyro
#

im making an endless runner game, in which i have the player moving towards the right, with the camera following him, and i generate platforms with random variations in their design which remain stationary and don't move anywhere.

i wanted the platforms which go off screen/off camera to get deleted. So, I created an empty called remover with a trigger collider and wrote a script for the platforms to delete themselves when they touch the remover object. However, voidontriggerenter2d just... doesnt work. In the image attached here (screenshot from game during runtime), the trigger is very clearly colliding with the platforms, but the ontriggerenter2d just doesnt register it for some reason.

#

heres the screenshot of the very basic script

frosty whale
opaque gyro
#

and its okay if the rigidbody is static ?

frosty whale
#

should be

opaque gyro
#

lemme check

#

ill give the remover object the rigidbody

frosty whale
#

Note: Trigger events are only sent if one of the Colliders also has a Rigidbody2D attached. Trigger events are sent to disabled MonoBehaviours, to allow enabling Behaviours in response to collisions.
from the docs

opaque gyro
#

yeah it works, it doesnt work with static tho only when rb is kinematic