playMaker

Author Topic: Off track timer  (Read 1452 times)

ShazBang

  • Playmaker Newbie
  • *
  • Posts: 33
Off track timer
« on: June 02, 2016, 03:52:39 AM »
Hey, making a simple racing game for a project and I'm having some trouble adding a timer that counts down whenever the player's car leaves the track... once the timer hits zero then the player loses the game and has to restart.

How should I go about checking that the player has left the track? I've tried using triggers but they take a very long time to set up and my track is huge! I'm using EasyRoads3D for the track by the way. I have some ideas on doing the timer but I mainly need help the player leaving the track

Thanks

ShazBang

  • Playmaker Newbie
  • *
  • Posts: 33
Re: Off track timer
« Reply #1 on: June 02, 2016, 03:56:03 AM »
I've found that the EasyRoads road object has a collider built into it, but it isn't able to be a trigger unless I make the collider convex, which screws the road up completely... is there another way to create a trigger on the road object?

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Off track timer
« Reply #2 on: June 02, 2016, 04:00:56 AM »
Hello,
you could check ground layer for the road so if it's offroad for x seconds, it counts as off track.
Check it with grounded if wheel colliders or raycast from the car, like every second or so.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Off track timer
« Reply #3 on: June 02, 2016, 05:04:34 AM »
Hi,
Maybe you can duplicate the collider and make that as trigger?