Unable to add UnityEngine.Object properties to preset

echtnice

Member
1. Character controller variant (Ultimate Character Controller, First Person Controller, etc).
Third Person Controller

2. Unity version (include which SRP, beta Unity versions aren't supported)
2019.3.9f1

3. Bug description
I can't add the property "Surface Impact" to CharacterFootEffects State Preset.
All other properties seem to work fine.

4. Steps to reproduce
- Open the Opsive ThirdPersonControllerDemo
- Select Nolan in Hirachy
- Create New Preset for "Character Foot Effects" MonoBehavior
- In the newly created Preset try to add Property "Surface Impact"
- Note that nothing happens ....

5. The full error message (if any)
no error
 
Thanks, this looks like it is a serialization issue. We are going to be releasing version 2.2.1 soon and I'll make sure to include this. Here's a preset that you can use in the meantime: https://easyupload.io/6imad9
 
This is with the FirstPersonController v2.2f. I can select 'Muzzle Flash' from Add Property; however, it never adds a control for the Muzzle Flash. I can add 'Pool Muzzle Flash'. It seems like ther are numerous properties that wont add, and it looks like it is those that require a GameObject.

No errors are thrown, as well.

I am using Unity v2019.3.3f1
 

Attachments

  • SuppressedGlock18CShootableWeaponPreset.asset
    621 bytes · Views: 1
After looking at the code in PersistablePresetInspector, it looks like on line 140 'object value = null', but the Object is failing the following test on Line 141:

'if (!typeof(UnityEngine.Object).IsAssignableFrom(property.PropertyType)) {'

This causes it to always call ' Serialization.AddProperty(property, value, null, preset.Data, m_Visiblity);' on line 186 with value always being null.

Its PreopertyType is 'UnityEngine.GameObject MuzzleFlash'

I'm attaching a screen pring of the debugging from VS2019.

FPC_PErsistablePresetInspector_FailedIsAssignableFrom.png
 
One last thing to post. On the included ShootableWeaponPResets with the current version of First Person Controller (v2.2f), the property is there, with a value, howevver; if you remove it, it cant be readded.
 
Thanks for debugging. I am merging this thread with the other similar report. This has been fixed in 2.2.1 which will be released soon. Your current workaround of duplicating an existing property will work for now.
 
Thanks for debugging. I am merging this thread with the other similar report. This has been fixed in 2.2.1 which will be released soon. Your current workaround of duplicating an existing property will work for now.
Thanks!!!
 
Top