Hello.
I am trying to implement a custom Action, that would change
playerData of a selected player, that is not the current one.
The reason for this is that in our gameplay we can switch from player A to B and then make player A to follow player B. The issue here is that when we switch back to player A, he will go back to where we switched to player B.
I was looking into the function
KickStarter.saveSystem.SaveCurrentPlayerData () but was unable to find a way to recreate this for a inactive player.
My Action would receive the player to alter, new coordinates in form of a Marker with prefab ID and the name of the scene we are currently in.
Thank you for any help in advance!
Comments
Now that I think of it, I might aswell use Replace NPC instead of Restore position.
Restore position was intended for cross-scene switching, where I can switch via UI.
Is for this case any solution? I don't think that replacing NPC is going to work here(or maybe Appear in other scene?).
Weird is that I am getting an error when trying to switch back to my original character: NullRef AC.Char.get_CanPhysicallyRotate () (at Assets/AdventureCreator/Scripts/Character/Char.cs:3816).
I do have constant IDs on all objects, but I'll research further.
Something else: Is it possible to restrict the usage of hotspots(all but one) from a specific player other than manually checking current player with every hotspot?
As always, I really appreciate your help. Thank you!
Thank you for you hint. We figured that this approach is way to unstable and would probably cause some issues further on.
So I used switching with NPC instead, like you suggested in your comment above. Thank you!