Dynamic prefabs break most triggers
closed
Phasedragon
The only triggers that work inside of a dynamic prefab are those that only reference to within their own gameobject, triggers that reference outside of the dynamic prefab entirely, and the ActivateCustomTrigger action. In other words, if you want to communicate anything from one gameobject to another, you have to use a custom trigger. You cannot directly set states/animator values/etc. For example, if you want a button to turn on a light, you wouldn't be able to turn the light gameobject on directly from the button. Instead you'd have to create a custom trigger on the light's gameobject that turns the light component on, then call that custom trigger from the button. This effectively doubles the amount of triggers required, unless you use a central animator to control everything.
This bug isn't necessarily a critical flaw since there is a workaround, but if you aren't aware of this workaround it would leave you searching for bugs for hours. Plus the increase in triggers will likely harm performance, as marginal as it may be.
Log In
Phasedragon
This bug report is still valid and has been confirmed by multiple other users. The reason it was closed was a misunderstanding with what dynamic prefabs are. Dynamic prefabs are different from regular unity prefabs, and are designed to allow references to the rest of the scene.
Here is a package with a scene that demonstrates the issue and it's workaround.
owlboy
Can a note be placed in the official docs?
Mr Q
closed
Not a bug, Unity doesn't support Prefabs that reference a scene object
Mr Q
This is by design, Unity prefabs can't reference anything that's in a scene due to prefabs not being tied to a specific scene.
A prefab isn't contained in the scene and therefore can't reference something that's in the scene since the prefab can be used in any scene and needs to work in all.
So it's not a bug, it's simply how prefabs work in Unity.
Phasedragon
Mr Q: that is the case with unity prefabs, but dynamic prefabs are different and made by vrchat specifically to allow references to the rest of the scene. These outside references work fine, it's the internal referencing and triggers that do not work.
kawashirov
I confirm this. Using direct triggers makes bunch of errors at runtime like this:
2018.09.11 17:45:01 Log - [VRC_TriggerInternal] 9489.225 OnShow via OnEnable executing [AnimationBool (True, 0.000, 0, "Handle", Show, 0)]
2018.09.11 17:45:01 Error - [VRC_EventDispatcherRFC] Not executing event [ of type AnimationBool (True, 0.000, 0, Handle, Show, 0) for 1] because no nearby events of that form exist.
But when using ActivateCustomTriggers proxies it's works well:
2018.09.11 17:57:17 Log - [VRC_TriggerInternal] 10223.97 OnShow via OnEnable executing [ActivateCustomTrigger (False, 0.000, 0, "Handle", Show, 0)]
2018.09.11 17:57:17 Log - [VRC_EventDispatcherRFC] ActivateCustomTrigger:Show on (Handle)
2018.09.11 17:57:17 Log - [VRC_TriggerInternal] 10223.97 Handle via Custom executing [AnimationBool (True, 0.000, 0, "Handle", Show, 0)]
2018.09.11 17:57:17 Log - [VRC_EventDispatcherRFC] SetAnimatorBool:Show on (Handle) to True