Cinemachine and control of a third person character with UMA

wizard

New member
I wonder if there is a best practice on how to take control of a character with UMA to properly rotate/move it and also use its abilities in a Cinemachine cut-scene.
So the designing of cut-scenes would be efficient enough. And return control to a user once a cut-scene is over.
 
When the cutscene starts you should first disable input using OnEnableGameplayInput, and from there treat the character as an AI agent.
I've found this snippet. As far as I understand it could be used here.

C#:
        private void OnEnableGameplayInput(bool enable)
        {
            // Force stop the ability if the character no longer has input.
            if (!enable && IsActive) {
                StopAbility(true);
            }
        }

Also, is this one uselful here as well?

C#:
m_Ride.CharacterLocomotion.ManualMove = true;
 
Also, another example from the SwtichCharacters snippet. Is it a proper one?


C#:
            var playerInput = prevCharacter.GetComponent<Opsive.UltimateCharacterController.Input.PlayerInput>();
            playerInput.enabled = false;
            var handler = prevCharacter.GetComponent<Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler>();
            handler.enabled = false;
            var localLookSource = prevCharacter.GetComponent<Opsive.UltimateCharacterController.Character.LocalLookSource>();
            localLookSource.enabled = true;
 
I've found this snippet. As far as I understand it could be used here.

C#:
        private void OnEnableGameplayInput(bool enable)
        {
            // Force stop the ability if the character no longer has input.
            if (!enable && IsActive) {
                StopAbility(true);
            }
        }

Also, is this one uselful here as well?

C#:
m_Ride.CharacterLocomotion.ManualMove = true;
That is for creating your own ability, which you shouldn't need to do.

Also, another example from the SwtichCharacters snippet. Is it a proper one?


C#:
            var playerInput = prevCharacter.GetComponent<Opsive.UltimateCharacterController.Input.PlayerInput>();
            playerInput.enabled = false;
            var handler = prevCharacter.GetComponent<Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler>();
            handler.enabled = false;
            var localLookSource = prevCharacter.GetComponent<Opsive.UltimateCharacterController.Character.LocalLookSource>();
            localLookSource.enabled = true;
Yes, that will switch the input. Although by sending the OnEnableGameplayInput event you should get similar results.
 
Top