Use Navigation2D on TileMap - Click and move limit

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

Hello,

I’m new to Godot and i’m trying to acheiv a “Diablo-like” game just for the context.

I’ve got 2 Scenes :

Main with Tilemap in Navigation2D, an instance of Player and Line2D to see the pathfinding.

Scene 1
Player with a sprite - collisionShape - and Camera2D (Current : Checked)

Player  scene

I can move my Player on the title map, the camera follow the player, but it seems the player can’t move over the Windows setting (In Project Settings) , 1920*1080. Litteraly the purple line in editor.

How i can redefine this limitation ? I need to modify the Windows Settings ?
Thank you for the help.

Rzr.

What do you mean by “the player can’t move over the windows setting”? The player can’t move outside of a 1920x1080 square?

Ertain | 2019-09-28 16:49

:bust_in_silhouette: Reply From: Razorback1911

OKKK!
To get my mouse position i used event.position, i don’t know why but the value can’t be outside of the viewport. (Relative ?)

If someone is stuck at on the same problem :
Make sure you use this fonction to get the mouse position

  • get_global_mouse_position()

You can close the case.

GLHF :heart:
Rzr