Error on different Update method on ScriptableObjects

Hello,

I created a ScriptableObject which needs to be updated each frame like MonoBehaviour. That’s why I made a component which contains a reference of my instantiated ScriptableObject, and then I call an update method on it.

The problem is that my method is “TestSO.Update(float deltaTime)” and the console throws me that error :

Script error (TestSO): Update() can not take parameters.

I think this is a bug because ScriptableObjects can not be updated with the Update() method like MonoBehaviours are. And, even if I declare an Update() method, it is never called at runtime.

I’ve got that error on any Unity version I could get (2021, 2022, and 6).

1 Like

I agree, this check should not extend to ScriptableObject scripts. I was just starting a new project with Unity 6 b13, so I confirmed the issue and sent a bug report: CASE IN-73338

Besides renaming the method, Update() w/o parameters will also work since you can get Time.deltaTime from anywhere.

Fixing it might be a pretty heavy engine lift, if this is true:

https://discussions.unity.com/t/609101/11

Video talk:

https://discussions.unity.com/t/609101/13

I would plan on NOT having it ever get fixed. Your mileage may vary.

1 Like

Just rename it to Tick, it’s kinda a standard in the gaming industry.

2 Likes

Adding On to an event is common too so you could just name it OnUpdate.

3 Likes