Saving/Loading Player Spawn Point with Complex Player Rig

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
kenlem
Posts: 26
Joined: Sun Aug 16, 2020 5:19 pm

Saving/Loading Player Spawn Point with Complex Player Rig

Post 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.
User avatar
Tony Li
Posts: 22135
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Hi,

You can make a subclass of PositionSaver for your player and override the SetPosition method.
kenlem
Posts: 26
Joined: Sun Aug 16, 2020 5:19 pm

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

Post by kenlem »

That will work when I load a scene with a spawn point?
kenlem
Posts: 26
Joined: Sun Aug 16, 2020 5:19 pm

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

Post 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.
User avatar
Tony Li
Posts: 22135
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Glad to help!
Post Reply