How do I detect when the camera limit is reached?

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

So I’m trying to make a platformer. I have a KinematicBody2D inside of it with a sprite, a CollisionShape2D, and a Camera2D inside. The camera has a limit:

Image

That way, when they fall down off of a platform, then their camera just stays like a lot of platformers do.

The thing is, it doesn’t respawn you.

So how can I detect when the limit is reached, wait 2 seconds, and then respawn the player? Thanks

Have you looked into using the limit_* properties of the Camera2D node?

Ertain | 2022-07-01 23:39

:bust_in_silhouette: Reply From: Inces

You can also use VisibilityNotifier node. Add it as a child of player, it will emit screen_exited signal when your player leaves visible screen. Connect to this signal and respawn the player when it is emited.

:bust_in_silhouette: Reply From: boston2029

I ended up making a fallzone.