First Person Issue

CitrioN

New member
Hello,

I wanted to integrate the climbing pack into my game project today and realized that the arms are not visible for any of the abilities.
I was chatting with a discord moderator who was so kind to even import the climbing pack and test it on his machine.
He was using the UCC for which the arms showed up. I wasn't sure if it was some weird behaviour from updating the first person controller or something else in my project so I tested it in a fresh project.
Unfortunately arms still won't show up for me when using the First Person Controller (v2.3.6) and the climbing pack add-on (v1.0.3)
Something that the moderator pointed out was to look for 'Third Person Object' script on Armor_Arms and Body_Arms GameObjects.
Those appear to be missing on mine so the arms will always be faded out.

Is this indeed a bug or do I have to take additional steps to get the demo scene to work?

Thanks,
CitrioN
 

Attachments

  • ClimbingPack_FadedArms.png
    ClimbingPack_FadedArms.png
    400.5 KB · Views: 0
I believe the Object Remover automatically removes the Third Person Object component for the demo scenes. If you add this component back to the arms and force it to be visible then they should no longer disappear.
 
It does indeed remove the ThirdPersonObject component from the arms and armor.
I did check by enabling the third person controller scripting define to avoid having it being removed when the scene is loaded.
I copied the scripts values and pasted it back after reverting the scripting define.
Unfortunately that doesn't seem to be the only thing affecting the arms from not showing up.
The arms never show up even if force visible is ticked.

After that I did check the ObjectRemover script and inspected what is actually being removed.
Turns out that 3 other scripts appear to be affected as well.
The PerspectiveMonitor on Nolan and the ObjectFader on the MainCamera and also the helmet and the ThirdPersonObject.
Both the PerspectiveMonitor and the ObjectFader are part of the ThirdPersonController package which I had to import to figure out what those 2 missing scripts were.
With them being not in shared I assume the hands can't show up in first person controllers as those scripts are missing!?

Is can't imagine this being intended behaviour when the abilities are intentionally utilizing the third person animations I would assume it only makes sense to keep those scripts on the respective objects to ensure the demo scene works for any controller?

Thanks,
CitrioN
 

Attachments

  • FirstPersonController_ThirdPersonObject.png
    FirstPersonController_ThirdPersonObject.png
    360.8 KB · Views: 6
It does indeed remove the ThirdPersonObject component from the arms and armor.
I did check by enabling the third person controller scripting define to avoid having it being removed when the scene is loaded.
I copied the scripts values and pasted it back after reverting the scripting define.
Unfortunately that doesn't seem to be the only thing affecting the arms from not showing up.
The arms never show up even if force visible is ticked.

After that I did check the ObjectRemover script and inspected what is actually being removed.
Turns out that 3 other scripts appear to be affected as well.
The PerspectiveMonitor on Nolan and the ObjectFader on the MainCamera and also the helmet and the ThirdPersonObject.
Both the PerspectiveMonitor and the ObjectFader are part of the ThirdPersonController package which I had to import to figure out what those 2 missing scripts were.
With them being not in shared I assume the hands can't show up in first person controllers as those scripts are missing!?

Is can't imagine this being intended behaviour when the abilities are intentionally utilizing the third person animations I would assume it only makes sense to keep those scripts on the respective objects to ensure the demo scene works for any controller?

Thanks,
CitrioN
Ever have any luck with this? I am running into the exact same issue
 
Unfortunately not. I haven't really put more time into it since I currently don't rely on the abilities that are affected by this issue.
However, I think if you own both controllers you should be able to have them shown if you manually add those scripts that get removed.
 
I don't own both controllers though... just first person. This is really dumb if I need the third person controller just for this (even though the perspective never changes from first person)
 
Right now with just the First Person Controller you will need to swap out the materials through script with a first person view. You can subscribe to the OnCharacterAbilityActive event. I still have this on my list to prevent you needing to do it with your own script.
 
"I used the VisibleThirdPersonObject state preset named FirstPerson on the arms and head, also turned off manual swap on the camera.
This way as soon as the game starts" Try this and see if it helps

You can also try adding this code to your editor
for (int j = 0; j < renderers.Length; ++j)
{
var materials = renderers[j].sharedMaterials;
for (int k = 0; k < materials.Length; ++k)
{
materials[k] = shadowCaster;
}
if (renderers[j].GetComponent<Character.Identifiers.ThirdPersonObject>())
{
SerializedObject o = new SerializedObject(renderers[j].GetComponent<Character.Identifiers.ThirdPersonObject>());
SerializedProperty p = o.FindProperty("m_VisibleMaterials");
p.arraySize = renderers[j].sharedMaterials.Length;
for (int v = 0; v < renderers[j].sharedMaterials.Length; v++)
p.GetArrayElementAtIndex(v).objectReferenceValue = renderers[j].sharedMaterials[v];
o.ApplyModifiedPropertiesWithoutUndo();
o.Dispose();
}
renderers[j].sharedMaterials = materials;
Shared.Editor.Utility.EditorUtility.SetDirty(renderers[j]);
}
 
Top