Can't have an update statement in both scripts

I ran into a strange error where I couldn’t have an update (every frame) in two scripts at the same time. I’m supposed to be making a timer (which has to update every frame) and a dropper which has to constantly check if 3 seconds have passed (every frame) before it can drop the object via gravity.

Hi,

What do you mean by “I couldn’t have an update (every frame) in two scripts at the same time”? What exactly did you do? How did you verify your assumption that the update did not work?

I had one update, as usual, in two scripts, and when I tried to test the game, it wouldn’t let me, saying that I couldn’t have an update in 2 scripts at once

Can you share this code and the message. Because this is not right. No-one will be able to make a game if you can’t have an update in 2 scripts

Edit: The only thing I can think of right now (without seeing the code) is that the script is partial and that there is an Update in both files

What is “it”? The console? If so, it would be great if you could share the console output and your code.

Generally, error messages make sense only within a context. To be able to interpret them, one needs the context. Otherwise, they are “meaningless” like “the sky is blue” (which sky? mine? yours? What shall I do with this information?).

Without any context, I can only guess that there are maybe two Update methods in the same script? Or maybe two scripts/classes with the same name? That’s not allowed in Unity/C#. Everything must be “unique”.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms