How would I display a message if my player walks into a collisionshape2D, or perhaps an area2D node?

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

When my player walks to the edge of the world, I want it to display the message “You can’t go there” and also I don’t know how to zoom in the camera.

:bust_in_silhouette: Reply From: kidscancode

This depends on what type of node your player is. If you’re using an Area2D or one of the PhysicsObject2D nodes (RigidBody2D and KinematicBody2D), they each have ways of detecting things. Note that Area2D does not collide - it detects overlap, but does not prevent it.

See here for more information:

If you’re using a Camera2D, it has a “Zoom” property in the Inspector.