Control Freak 2 integration not working

m633games

New member
Hi,
I'm using Control Freak Version 2.8.9 and Third Person Controller v3.0.13 on Unity 2022.3.4f1

CF2 was working great on Third Person Controller v2 but when I upgraded to v3 it doesn't work anymore. I started a brand new scene, added my own character and it works fine with the built-in TPC Virtual Controls, but when I follow the instructions at https://opsive.com/support/documentation/ultimate-character-controller/integrations/control-freak/ I get an error. I selected my character->characterInput and I tried to use the Control Freak 2->Integrations->Opsive UCC->Add CF2 input to selected object. Here is the error:

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.Abilities.Ability.CanInputStartAbility (Opsive.Shared.Input.IPlayerInput playerInput) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:329)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler.UpdateAbilityInput (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:132)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler.UpdateAbilityInput () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:100)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler.Update () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:75)

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.CharacterHandler.GetPositionInput (System.Single& horizontalMovement, System.Single& forwardMovement) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterHandler.cs:72)
Opsive.UltimateCharacterController.SimulationManager+SmoothedCharacter.Move (System.Boolean preMove) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/SimulationManager.cs:165)
Opsive.UltimateCharacterController.SimulationManager.MoveCharacters (System.Boolean preMove, System.Single interpAmount) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/SimulationManager.cs:729)
Opsive.UltimateCharacterController.SimulationManager.FixedUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/SimulationManager.cs:673)

If I manually copy the Control Freak Input component without going through the Control Freak 2->Integrations->Opsive UCC menu I can see the CF2 controls on the screen but when I try to use them the character doesn't move. I also added the CF2 Event System and Gamepad manager and it doesn't work.

Thanks
 

Attachments

  • 2023-07-04.png
    2023-07-04.png
    425.8 KB · Views: 5
On your character do you have the PlayerInputProxy linked to the ControlFreakInput component?
 
PlayerInputProxy on my Character has the following settings:
Script: PlayerInputProxy
Player Input: <My CharacterName>Input (Unity Input)

<My CharacterName>Input (Unity Input) only has the Control Freak Input script enabled

Is there anything I need to change to the PlayerInputProxy?
 
That is correct. The error that you are getting indicates that the ControllerHandler can't find a IPlayerInput. Within UltimateCharacterLocomotionHandler.AwakeInternal does m_PlayerInput get set correctly?
 
Thank you for your answer Justin, it helped me. The problem was that I didn't follow "Step 4) On the Player Input Proxy component on the character set the Player Input reference to the Control Freak Input component" properly, now it's set up correctly and it works.

PlayerInputProxy on my Character should have been:
Script: PlayerInputProxy
Player Input: <My CharacterName>Input (Control Freak Input)

instead of
Script: PlayerInputProxy
Player Input: <My CharacterName>Input (Unity Input)
 
Last edited:
Top