Hi,
I'm struggling to understand the use of Constant ID and prefabs. I'm working on creating a prefab to open and close doors using PlayMaker. Here's the structure I've set up:
Both hotspots share the same action list from the asset file. I've created a parameter to reference the Door_Location instances in the scene. Each object has a Constant ID script. However, the event is still not being sent to the parent FSM. I suspect I might be doing something wrong with the Constant IDs.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Looks correct, at a glance.
What are your AC / Unity versions, and how many instances of a prefab would typically go into a scene? I'll attempt a recreation.
Unity 2022.3.25.f1
AC 1.80.4
So far I have 3 instances of the prefab in the scene, each referencing its own FSM object (each door/mesh has its own FSM that plays the door animation.)
Is it normal that each one of the 3 gameobjects that I listed has a different Constant ID?
Update: I just realized that if I change the "Hotspot parameter" to (No Parameter) the door Opens, but the hotspot that is activated at that moment ("Hotspot_OpenDoor") is showing "Current State: Off". I'm not disabling anywhere; I enable/disable the hotspot gameObject instead.
I have no idea about what the Hotspot Parameter is supposed to do.
When placed in the scene, do the "FSM Object" fields in the Set Interaction Parameters component correctly reference the that instance's Door_?
I'm not experiencing an issue specific to CIDs/prefabs - it works for me if I use e.g. an Object: Visibility Action to hide the child object.
Can you share a screenshot of the Action/ActionList itself?
If you can pause the game while the ActionList is running (add an "Engine: Wait" if it's currently instantaneous), select the runtime instance of the ActionList asset and view its properties - what value does the parameter have? In a backup/dupicate project, check also the issue in the latest release.
Check my updated comment above.
The "Hotspot Parameter" assigns the Hotspot's GameObject itself - it'll override the assignment in Set Interaction Parameters, so if you use that component, leave the "Hotspot Parameter" to none.