When the player exits area set the position back to before

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

So I’m making a school rpg and when you leave the room I want it to make you go back to the position before you left the room/area2d.

I’ve tried all that I know but haven’t figured out how to .

Can someone help me?

store the last position in a variable and connect a body_exited signal that resets the players position when it is fired.

if youre new i highly suggest this tutorial it will teach you some basics of the engine

OgGhostJelly | 2023-01-08 13:12

Hello, I just tried this and it didn’t work.

Any other way?

By the way i’m an amateur

Jimmy106_ | 2023-01-08 15:24

you could try adding an area2d to the player, and connecting its area_exited signal to check if you left a room

there isn’t any other way that I know of to check if an object exited an area2d

OgGhostJelly | 2023-01-09 01:54