Page 1 of 1

Saving/Loading Player Spawn Point with Complex Player Rig

Posted: Wed Feb 15, 2023 9:54 pm
by kenlem
Hi,

I want to be able save and load my player position but my player rig is a bit complicated and can't be moved by just moving one part of it. It needs to be moved by a call to my player controller. I'm not sure how to go about using a position saver. My first thought was to write my own custom saver which looks easy enough. The problem is that I want to be able to hook into the load scene call with a spawn point name like LoadScene("scene@spawnpoint").

Any suggestions?

Thanks.

Re: Saving/Loading Player Spawn Point with Complex Player Rig

Posted: Wed Feb 15, 2023 10:29 pm
by Tony Li
Hi,

You can make a subclass of PositionSaver for your player and override the SetPosition method.

Re: Saving/Loading Player Spawn Point with Complex Player Rig

Posted: Wed Feb 15, 2023 10:49 pm
by kenlem
That will work when I load a scene with a spawn point?

Re: Saving/Loading Player Spawn Point with Complex Player Rig

Posted: Thu Feb 16, 2023 6:23 am
by kenlem
Tony Li wrote: Wed Feb 15, 2023 10:29 pm Hi,

You can make a subclass of PositionSaver for your player and override the SetPosition method.
Worked like a charm. Just amazing...

Thanks for the support.

Re: Saving/Loading Player Spawn Point with Complex Player Rig

Posted: Thu Feb 16, 2023 1:58 pm
by Tony Li
Glad to help!