Bug FinalIK Bridge?

tensor

New member
FinalIK is disabled using the bridge?
```
public KinematicObjectManager.UpdateLocation UpdateLocation { get { return m_UpdateLocation; }
set {
if (m_UpdateLocation == value) { return; }
m_UpdateLocation = value;
EventHandler.ExecuteEvent<bool>(m_GameObject, "OnCharacterChangeUpdateLocation", m_UpdateLocation == KinematicObjectManager.UpdateLocation.FixedUpdate);
}
}

```
ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Opsive.Shared.Events.EventHandler.GetActionList (System.Object obj, System.String eventName) (at <27da9e1afec54f2fb2a11d46a234f9df>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1] (System.Object obj, System.String eventName, T1 arg1) (at <27da9e1afec54f2fb2a11d46a234f9df>:0)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.set_UpdateLocation (Opsive.UltimateCharacterController.Game.KinematicObjectManager+UpdateLocation value) (at Assets/Plugins/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:170)
Opsive.UltimateCharacterController.Integrations.FinalIK.FinalIKBridge.Awake () (at Assets/Opsive/UltimateCharacterController/Integrations/Final IK/FinalIKBridge.cs:126)


Also related question do I access the Opsive StateMachine then read the state and edit weights and targets to final IK that way or is there a better way? Thanks
 
FinalIK is disabled on purpose. The IK components are updated manually. Unfortunately you will need to script in the FinalIK value changes as it does not use the state machine.
 
@Justin
I tried this set of instructions.

That error above is what showed up.

  1. Install the integration from above.
  2. Remove the Character IK component from your character (if it has been added).
  3. Add the Final IK Bridge component included in the integration package.
  4. Add any of the following Final IK components:
    • Full Body Biped IK: Used for humanoids, allows for finer positioning of the character’s limbs.
This is the error below.
```
public KinematicObjectManager.UpdateLocation UpdateLocation { get { return m_UpdateLocation; }
set {
if (m_UpdateLocation == value) { return; }
m_UpdateLocation = value;
EventHandler.ExecuteEvent<bool>(m_GameObject, "OnCharacterChangeUpdateLocation", m_UpdateLocation == KinematicObjectManager.UpdateLocation.FixedUpdate);
}
}

```
ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Opsive.Shared.Events.EventHandler.GetActionList (System.Object obj, System.String eventName) (at <27da9e1afec54f2fb2a11d46a234f9df>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1] (System.Object obj, System.String eventName, T1 arg1) (at <27da9e1afec54f2fb2a11d46a234f9df>:0)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.set_UpdateLocation (Opsive.UltimateCharacterController.Game.KinematicObjectManager+UpdateLocation value) (at Assets/Plugins/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:170)
Opsive.UltimateCharacterController.Integrations.FinalIK.FinalIKBridge.Awake () (at Assets/Opsive/UltimateCharacterController/Integrations/Final IK/FinalIKBridge.cs:126)
 
That worked for me. I suppose I just enable it when I need it as a part of a particular state and shut it off when I don't need it.
Though is there a way to listen for state changes?
In the game manager, in State Manager,
I turned out Send State Change
```c#
Then Created a Listener in a script on the Character
Put this in Awake() and I tried the same on Enable() when it failed to work in awake()

EventHandler.RegisterEvent<GameObject, string, bool>(gameObject,"OnStateChange",stateChangedAdjustIK);

private void stateChangedAdjustIK(GameObject state, string stateName, bool active) {
Debug.Log($"{state} {stateName} {active}");
}
```
it does trigger a state change however, the listener is never called. Did I make a mistake somewhere?
 
Ok I figured out my issue, I shouldnt include gameObject as a parameter since, it is a global event
 
Top