How do you know to delete void start and void update and make your own void?

I’m on the 2d course and I don’t understand why Rick in a lot of the scripting lessons will say let’s delete this and write his own private or public voids instead. How am I meant to know to put my code in void update or not?

The two functions are just two unity functions. If you don’t have anything that has to happen when the class is called on the start of your program and on every frame then you do t actually need the method.

For example say you place a cube on the ground to act as a teleporter that you want send the player to another part of the scene when they walk on it. You don’t need it to do anything on start or update. But maybe you need OnCollisionEnter() or OnTriggerEnter() to respond to the event and that is all.

1 Like

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

Privacy & Terms