Turned off Locomotion and turned it back on - Now no animation?

ChargerIIC

New member
I have a scene which is a character creator. Since I don't want the character to wander off during the process (or have the UTPC controller take control away from the UI), I disabled the UltimateCharacterLocomotion and UltimateCharacterLocomotionHandler component and passed the OnEnableGameplayInput event (with a flag of false) to disable the input . Everything works well until I try to pass the newly created character into the next scene. I enable input, turn on the related components, and my input switches over but none of the animations play. The character just stands in place as they glide across the map.

Below is the code I have toggling the relevant code. (Passing false in the character creator screen and true in the gameplay screen). I'm using Ultimate Third Person Controller with the ThirdPerson Combat view:

C#:
        public void ToggleInputModel(bool flag)
        {
            InputActive = flag;

            EventHandler.ExecuteEvent(gameObject, "OnEnableGameplayInput", InputActive);

            GetComponent<UltimateCharacterLocomotion>().enabled = flag;
            GetComponent<UltimateCharacterLocomotionHandler>().enabled = flag;

        }

Am I missing something? Is this the right way to achieve the effect?
 
You should only need to call the OnEnableGameplayInput event - when that is false it will stop all input.
 
Thanks - it helped me figure out what I needed to do.

If anyone else is trying to figure out a similar issue I had to make the following changes:

When in the Character Creator, I leave the Ultimate Character Locomotion Manager enabled but set the movement mode to 'Idle'. When Idle, the character can't do anything but stand there so it works out well.

I had to make certain the default animator was changed from UMA's 'Locomotion with Head' to the Ultimate Character controller. The UMA one only contains matching steps for running and not walking or jumping. (This part is actually in the integration instructions but I apparantly missed it)

When I load into a gameplay scene I now perform the following steps:

1) I assign the playercharacter to the camera (since it's carried over from the previous scene the camera controller actually has trouble finding it by itself)
2) I set the locomotion controller's movement type to the desired (Third Party Combat in my case)
3) I set the position of the character via the locomotion controller's SetPosition command to the desired start location (Important! If you use transform.setposition like you do for other unity objects the camera and player won't change position properly. )

I'm now able to roam The City to my hearts content after the changes, sporting my new duds:


2019-06-06_7-16-41.png
 
Top