- Home /
Should my Scriptable Object reference some prefab while that prefab is referencing that Scriptable Object?
I created some Scriptable Objects to use them as a data container. It holds list of floats such as damage, range, speed, impact... et cetera. Scriptable Object also has a prefab gameObject in it for the "bullet".
So when I press "Shoot" button, the shooter script will first check scriptable object to be used, and then find the appropriate prefab in the scriptable object. Bang! Instantiates the said prefab gameObject found in the Scriptable Object.
Now, that bullet object's Monobehavior gets its data from the scriptable object as well. Prefab already has Scriptable Object wired in as a variable, so it'll calculate the damage, range, speed... etc based on the data listed in the scriptable object.
While the game has been working flawlessly, I came across some posts suggesting that people had issues when they make scriptable object reference prefab, while prefab references that scriptable object. Ehh... but my game's running great. So far.
Do you think it's fine practice to continue building my game in the current method? Or are there better ways to handle scriptable object referencing prefab while prefab gets its data from that scriptable object?
Your answer
Follow this Question
Related Questions
is having a Prefab reference inside a a Scriptable Object legit? 0 Answers
Should I be using Scriptable Objects that only contain a method implementation? 1 Answer
Adding behaviors to a game object at run time via scriptable object 1 Answer
How do you save a reference to a prefab's script in a ScriptableObject? 0 Answers
Is it bad practice to have method definitions in a Scriptable Object? 0 Answers