Going back to 0 0 0 pos when clicking on sky

Hey so i made a top down view template to see how it work and stuff and i noticed that when you click on the sky it will make your player walk all the way back to the position 0 0 0 (or where ever you player start is)

Here is an example https://gyazo.com/e22f44ae1674a6e07344482b301cb02b (the cube is the middle of the map)

i don’t really understand how it is doing this and how i could fix this if anyone have a answer for this question let me know thanks.

Two things could be happening,

  • the sky’s position is 0,0,0, hence it’s going to 0,0.
  • the sky click is causing an invalid value which gets interpreted as 0,0.

On click, cast the clicked actor, if it’s the sky, do nothing. Or rather, check that the player has clicked the floor and nothing else :slight_smile:

Hope this helps.