I just started learning Unity a week ago (coming from Roblox, haha), and I’m working on a game for a Game Jam. So far, I have a boat that can drive around the ocean, and I’ve added a distance tracker. I want the game to be like A Long Drive, where random events happen while you’re driving the boat. For example, a “Storm” event might randomly trigger, which would change the lighting and other things, and after a while, it would go back to normal. Then, another random event could be triggered after some time.
Would using a state machine be the best approach for this, or is there a better way to handle these random events? Also, here’s a gif of my game so far!
The simplest approach would be to randomly place scripted objects around the world with their colliders set to be triggers and then when your boat touches them the scripts can be triggered.
BTW - Perhaps change your texture to a normal mapped water surface texture. Your current texture is a caustic water texture which is what we would expect to see projected onto the ocean floor when in shallow water. Or perhaps make the boat a submarine?
For random events that happen over time, just having a monobehaviour ticking away can do the job. Either you roll a random interval each time, or you slowly accumulate random values until a certain threshold is met. Then you just fire off the event and reset the timer.