Spent about a week trying to debug this.
AC version: 1.64.2
Unity: 2017.4.1
I have a Door prefab:
DoorParent is empty.
Doors1 has:
Constant ID is set to Automatic and Retain in Prefab is unchecked.
This Door prefab is instantiated at runtime throughout the world (I am using DunGen to generate the level. Every wall has a doorway created procedurally.)
When I Run and check each Door in the scene, every one of them has the ID 11190210.
What am I missing?
I have a DoorHotspot child that uses an ActionListAsset to open the Door parent. It tries to reference the ConstantID but this doesn't work because all the other doors in the scene use the same Constant ID. I was hoping there was a "Hotspot Parent" action to reference the Door that I clicked the hotspot child on, but it doesn't seem so.
I have to keep the DoorHotspot as a child of the Door object itself because the Door object needs to be on the Door layer (since I don't want pathfinding to think of it as a obstacles). Since Hotspots can only be set up on one layer, I want to leave them on Default and not change them to Door. If I didn't need to make the hotspot as a child, or I could reference a hotspot's parent, this would be easier.
Comments
Prefab structure:
DoorParent:
Door_Frame:
Doors1:
DoorTrigger:
DoorHotspot:
I only have 1 Constant ID on the prefab, on "Doors1" child.
After running my level generation, every Doors1 object ConstantID is the same - 1879184
I have tried setting back and forth from manual to automatic to attempt to reset it, checking and unchecking retain in prefab, as well as remake the constant ID component. Always has the same result.
For level generation, I use DunGen:
https://assetstore.unity.com/packages/tools/utilities/dungen-15682
This places prefabs at runtime. I would have thought the ID assignment would still work as expected regardless?
Now the problem is involving AC knowing which door to affect. Since the Hotspot is a child object of the Door, how will clicking on that Hotspot know that it needs to affect its parent?
Doors1 is a parent to DoorHotspot
Doors1 cannot have the Hotspot component directly on it because it needs to be on a separate layer for navigation purposes and there is no option to allow Hotspots to be on multiple layers
Hotspot settings:
AssetFile Interaction "Door_Open":
If I make the Parameter = Hotspot, it will only affect the gameobject the hotspot is attached to, not its parent.
If I make the Parameter = Hotspot, it will also require a ConstantID, meaning I have to remove the Remember Transform ID from the Door parent because of the bug.
If I make the Parameter = Door's ConstantID, it only knows one specific door.
I need to be able to grab the ID of the Hotspot's parent that has just been interacted with.
It would be great in the future if integrating that function into AC Hotspot would be included. I normally parent my Hotspots to other objects and it would be nice to just check a box than adding a script each time. Just a thought.
Cheers -