So in the game I am making I have the idea of a player going into a device which is like another dimension sort of thing but only for as long as the player chooses and can be taken out of said device and put in at the push of a button (e.g. k)
and when the button is pushed to leave the dimension you get teleported to exact point you were before you entered the device. But I have no idea how to save the player’s location before getting teleported into the device. Help is appreciated.
Use the save game system.
Or you can store it in your game instance.
So, you need to save position before device activated? When you press button to activate device, you need cast to game instance and write character location to game instance. And when button presseed to leave from dimension again cast to game instance, get character location and set character location to character location you got.