DRIFT DRIVING QUEST: ‘Y No Jump?’ - Solutions

Quest: Drift Driving Quest
Challenge: Y No Jump?

Feel free to share your solutions, ideas and creations below. If you get stuck, you can find some ideas here for completing this challenge.

I just adjusted the Gravity Setting on the car controller script is that what everyone else did?

Kurt

No - and yours can jump all the ramps?

Yes but only properly with a speed boost

Kurt

There is another way that works ‘properly’. I think clues were in the console messages.

The layer mask was not set on the ground and on the ramps, and so the car was “not grounded” when it was on a ramp. I changed the layer masks, and it seemed to have fixed the problem…

I set up two states for the car, “grounded” and “not grounded” checking grounded condition at some frequency (originally in Fixed update, but I think that it can be checked less frequently, like every 0.1 or even 0.2 sec or something).

Yeah, I changed the groundLayers LayerMask to be “default” which includes both the ground and the jumps. Now when Physics.CheckSphere runs on a jump it shows the “I am grounded, yo” message.

For me, after researching LayerMasks, I went to Project Settings → Tags and Layers, and added a new Layer (called “groundLayer”). I set all the gameobjects the car will be driving over to “groundLayer”, and finally changed the LayerMask on the carController script to “groundLayer”.

Felt pretty good! I didn’t know much at all about LayerMasks before this, and now I feel more familiar with them.