How can I move the player to a safe spot?

Place to get help with not working mods / modding interface.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

How can I move the player to a safe spot?

Post by sparr »

I am doing LuaSurface.set_tiles() and might put water or not-on-map under the player. This kills the player.

I'd like to teleport the player to a nearby safe-to-exist spot. Is there an easy way to find such a spot?
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: How can I move the player to a safe spot?

Post by Nexela »

First teleport player away, then place tiles then player.teleport(surface.find_non_colliding_position(players original position, other options))

Something like that anyway.
Post Reply

Return to “Modding help”