#Trying to use Scriptable Objects that refer to Subscene Objects, Getting "Type Mismatch"

1 messages · Page 1 of 1 (latest)

limber finch
#

I have a system that makes a vehicle entity follow a set of waypoints.
Currently, I have an authoring object that accepts a "LoopSO" object, which has a list of float3 waypoints.
The vehicle baker is responsible for loading the waypoints into a dynamic buffer.

Instead of using hardcoded points in the SO, I'd like to refer to GameObjects/Components in the subscene, but I'm getting "Type Mismatch" when I try to include the field. I understand that the "cross-scene" reference is refusing to serialize. But, I don't particularly care about maintaining a reference to the baked entity. I just need the SO reference to the GameObject in the baking scene for the vehicle baker that's loading the waypoints into the buffer.

Anyone have any suggestions for a workaround?

sullen trench
#

instead of using a SO just store the 'points' (gameobjects) on your authoring script

#

you can't reference objects in scenes

limber finch
#

I was just typing a reply to that. It works, but it's not ideal. Lots of repeated configuration and I wanted to leverage SO's to manage the configuration easily.

sullen trench
#

well you just can't do it on a SO reference GOs in a scene for a simple reason
what if you load the same scene multiple times, which one is it referencing?

#

best i think you could do is use float3 but then create custom gizmo handlers

#

so they appear in the scene and are draggable to make positioning easier etc

limber finch
#

As an aside, @sullen trench, appreciate all your thoughtful and detailed forum posts. It's been an invaluable resource as I've been using ECS over the last 12 months.