I have a set of abilities that I have created for a character. These abilities are within a form of a scriptable object. When these objects are added to a script that I have attached to the player, he can then use the ability.
Question is: How can I use the action list editor to add a scriptable object to the characters list.
What I have done:
-I have created and inventory object to represent this ability as an in-game pickup.
-I have created a game object that represents this ability.
-I have created an action list to pick up the object and add it to my inventory.
What I have tried:
In the 'Use' action list of this ability I have tried to create an action such as:
Action type: Object - Call Event
Editor and Runtime: Add a game object that contains a list of these scriptable objects. Then pass a reference to the character code as to what ability to use.
This didn't work as the very long argument exception basically said that it failed to convert parameters.
I know you cannot attach a scriptable object to a game object, but I thought there may be a way to call it by reference. I'm not having much success with this. Or quite possibly I need to go at this from a different angle.
Any thoughts would be greatly appreciated!!
Comments
However, the general answer would be to create a custom Action that can talk to the ScriptableObject in exactly the way you want it to - see this tutorial. If you're familiar with C# scripting, I would say that's the best way forward.
Is the function correctly showing up in the Object: Call event Action, and have you tried placing a Debug line in the function itself? You could try using the Object: Send message Action instead.