0 votes

I have a player (KinematicBody2D) on a map made with TileMap and want to restrict the player to this space only. I already put a limit on the camera (so the player can't see spaces around the map). Is there any way to do this?

in Engine by (692 points)

1 Answer

+1 vote
Best answer

I believe the most common way to block the player is to add a "wall" around your tile map.
Either as an actual wall tile that blocks the player and is around the entire map, think Zelda where there are trees or mountains covering the entire side of the map.
Or an invisible wall which is basically a StaticObject2D without a sprite that simply does not let the player through, like GTA for example.

by (572 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.