The documentation for public graph variables mention that they can be overridden on a per-GameObject basis + etc without modifying the graph serialization.
Let’s assume this Prefab
+ Bad Guy
–> Detection Radius (CircleCollider2D)
And an asset graph with an exposed variable Detector (Collider2D).
If I drag Bad Guy into a scene, override Detector, and assign Detection Radius to it, things work fine.
If I open the Bad Guy prefab in Prefab Mode, override Detector, and assign Detection Radius to it, I get a message saying that I cannot reference scene objects in an Asset.
Do you override the variable in the blackboard attached to the GameObject “Bad Guy” or do change the reference on the internal blackboard of the graph? The latter is stored in the graph asset, whereas the former is living on the GO (and in the prefab).
Considering I understood correctly, the message shown in the graph editor is a known GUI-only bug that exists because of the variable previewing the overridden value. The GUI inspector code “sees” a Unity Object being referenced in an asset and as such shows that message, which is a false positive since things will still work fine in runtime after all (please confirm that this is indeed the case for you too).
I have “fixed” that by basically removing the exposed variables override value from being previewed in the next version unfortunately , since that was creating a lot of confusion. The one you mentioned being one of them and another confusion being when editing multiple GraphOwner prefab instances using the same Asset Graph but having different exposed variable overrides (there is a GUI-only bug there as well).