- Home /
Scriptable Objects for Status Conditions?
I am trying to make status conditions like poison, burn, slow etc.
I’m just trying to identify what logic is ok to use in scriptable obj vs monobehaviour.
Would it be good practice to have a scriptable object for burn extending from scriptable object StatusConditions. Inside it has IEnumerator function for damage over time.
I can assign that Scriptable Obj to my ability that casts it and then if hit an enemy assign the scriptable obj to the enemy. Then just do scriptableobj.Apply(); and the enumerator will damage the enemy it’s attached to.
I am not sure if that sort of logic is good practice to put in a scriptable object instead of a monobehaviour?
Alternatively I could tell my SO to attach a Burn monobehaviour to the enemy, which does the DOT.
Alternatively I could attach the Burn monobehaviour to an empty Go and add it to the Burn prefab that can be instantiated in the Scene and anything that hits it gets the DOT from the mono attached to Burn prefab. Prefab is destroyed once timer completes.
Which would be a better method?
Your answer
Follow this Question
Related Questions
List of ScriptableObjects lost on project reload 1 Answer
Set types of scripts i can place in ScriptableObject[] 1 Answer
Should I worry about having many 1000s of small files in my project? 0 Answers
How to fix "Assertion failed: dynamic_array" error on scriptable objects? 0 Answers
Can I active some static function in ScriptableObject? 0 Answers