How to switch characters in runtime?

Dagwin

New member
How to switch characters in runtime? (most recent Ultimate character controller)
It is mentioned in the documentation that it is possible but I can't find anything on how to achieve this.
 
This page explains how:

 
I made a new project with a fresh install of UFPS and TPC.
Then I tried the Demo scene to figure out how things are done.
Standing before the mirror where the character should change (I think that's what should happen) an error appears the moment I step on the orange ground. In the inspector I see the active model change from Atlas to Rhea.

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Items.Actions.ItemPerspectiveProperty.OnCharacterSwitchModels (UnityEngine.GameObject characterModel) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/CharacterItemPerspectiveProperties.cs:136)
Opsive.UltimateCharacterController.Items.Actions.ItemPerspectiveIDObjectProperty`1[T].OnCharacterSwitchModels (UnityEngine.GameObject characterModel) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/CharacterItemPerspectiveProperties.cs:514)
Opsive.Shared.Events.InvokableAction`1[T1].Invoke (T1 arg1) (at <d515f83de5944b65b7f28ce68e4a5f7c>:0)
 
With the combined set of independent assets make sure you are using the downloaded Ultimate Character Controller demo scene:


Note that the item perspectives currently have some issues but it has been fixed for the next update:

 
Downloading Demo did it. Thanks.
Why not including the full demo scene on install of both packages?
 
There are too many references that need to change because of the build process. Having it as a separate Unity Package makes the build process easier.
 
Top