First Game Level Restarts Suddenly

Hello,

So I’ve been teaching myself how to build video games not with the provided tutorial projects but with the Brackeys youtube videos, which I hope isn’t the problem.

So I’m making his cubethon game, which is a movement game where your cube (or in my case, a sphere) moves forward and beats the level by not hitting any of the barricades in its way.

My problem here is that when it gets to a certain meter 116, it restarts the level suddenly as though I’ve died but I’m not near any object as this is inbetween two sets of barricades (like a palate cleanser before the next challenge).

Could it be the number of obstacles I’ve built? Is this a usual bug? I googled and searched the forums but it didn’t seem like anyone else was having this issue. The console isn’t giving me any error messages. Besides just using the pre-made Unity tutorials next time, what are other resolutions?

The game builds just fine and the game also restarts exactly where it does in the preview. It does this on every level but it doesn’t seem to have to do with friction and the player’s just barely slowing down but isn’t stopping or hitting the sides of the ground plane. It’s like it’s hitting something that’s not there almost. I’m not sure when this issue began as it wasn’t doing this when I started building the game.

Thank you.

No, it’s not a usual bug. It’s a bug in your game, and you just have to track it down.

Use Debug.Log to check all your assumptions. Remove stuff that you think might be involved and see if the problem goes away. Think like a scientist, and just do one experiment after another until you have confirmed or refuted every assumption you’re making, and you will find the problem.

Is there a local Unity user group you can turn to for help? (Unfortunately this sort of debugging is not really something we can help much with via the forums.)

1 Like