- Home /
Question by
cosieja · Mar 05, 2019 at 02:29 AM ·
scripting problemscriptableobjectattackturn-basedfightingame
I want to use Scriptable objects to create enemy attacks and swap them out each turn. How do I access another SO and replace the one in the object?
I'm making a turn based fighting game (like Slay the Spire) and want my enemies to have specific attack patterns. I've created scriptable objects to hold the basic enemy data (image, health, etc) but I would like the attacks (a seperate SO) to change each turn. I've created another SO that is each of the attacks. I'd like to change the SO attack based on the turn. Is there anyway to swap out the attack SO's, in prefab each turn? I can't seem to access the SO through the GetComponent<> command. I've included a screen shot of the inspector.
Is there a different way I should be approaching this? Appreciate any help.
[1]: /storage/temp/134192-untitled-2.jpg
untitled-2.jpg
(195.8 kB)
Comment