- Home /
ScriptableObject error - parameterized "Update" function
I have not seen a question related to this, and hopefully someone knows the answer.
I've recently derived from ScriptableObject
and added a function with this signature:
public object Update(object[] pArguments)
This function is meant to be called by a MonoBehaviour
's Update
function.
The problem is that I'm getting this compile error in the console:
Script error: Update() can not take parameters.
There is no file or line number information; that's the error verbatim. However, I know it's related to this function definition because the error goes away when I modify either its signature or name.
I'm not asking for a fix, I can just rename the function obviously, but I'm wondering: Is this intentional behavior or is it a bug?
As far as I know, ScriptableObject
doesn't have any Update
hook like MonoBehaviour
does, because they don't work the same. So why should the compiler even be concerned about what kind of signature this function has?
It's probably a Unity bug. I'd recommend just rena$$anonymous$$g the function (if possible) in your scriptableObject.