My RPM prefab animates and moves properly at runtime, and is synced correctly to other players' runtime exe.
Environment: Unity 2022.3.17, URP. I've made my own Dance Floor project using the SF2X Buddy List and Shooter examples. I've a custom Game Controller script combining the Buddy messaging and the Shooter GameManager script. I've removed all the shooter-specific health, stats, shooting, etc functions, since all I need are transforms, rotation, walk, run, jump etc animations. References to the SF2X_GameManager in the character controller script is replaced now with references to my custom game controller script. This all works now.
Problem: "Spine" isn't recognized as a child component of my model, leading to errors in the console (spline field in the character controller is empty).
Test: if during runtime I fill the SF2X_CharacterController's 'Spline' field with my RPM avatar's Spine node, the errors stop.
Notes:
- The RPM avatar setup matches the Cowbow avatar in Unity (avatar meaning the Unity Avatar file that matches bones to spine, hip etc).
The Spine node is the same name and placement in both Unity Avatar setups.
- RPM downloaded prefabs use the Mechanim animator in its model settings, but the prefab uses the Unity Animator component, with the "SF2X_Animator" controller in the 'Controller' field so everything moves and syncs properly.
- Line 165 in the SF2X_Character Controller refers to the AimIK type. This script is attached to the Cowboy's Pistol model, attached to the Cowboy armature's right hand.
- I added a simple cube in the same place on my RPM model armature, and added this AimIK script to it.
Expected outcome: The SF2X_Character Controller script should locate the Spine node in my armature, and fill that field for me.
Actual outcome: doesn't work; the Spine field is not filled, leading to errors.
Question: Is the AimIK needed, and is there a likely reason SF2X_CharacterController isn't finding "Spine" in my RPM model?
My model is for dance clubs, and doesn't need this gun item. I could substitute a cell phone model, but in any case the spine filed is not filled.
The spine node in my RPM avatar is not being seen, but the location, name and position in the Avatar definition is the same as with the cowboy's prefab.
Update: replacing line 168 in SFX_CharacterController with line 175 fills the Spine field correctly, and the errors stop.
Code: Select all
if (isPlayer)
{
this.transform.GetComponentInChildren<SF2X_AimIK>().isPlayer = true;
spineTransform = animator.GetBoneTransform(HumanBodyBones.Spine).transform;
// spineTransform = GetComponentInChildren<SF2X_AimIK>().spine;
}
else
{
spineTransform = animator.GetBoneTransform(HumanBodyBones.Spine).transform;
}