- Home /
Detect when an object passes above a checkpoint
Hello, I'm very new to Unity and I need your help :)
I am creating a 3D simulation for a vehicle tracking and I need to use "checkpoints" on my track. In concrete terms, I want something which alerts me when the vehicle passes above a checkpoint position.
I added my checkpoints as standard GameObject cubes, I would just need a function that displays "CHECK" when my vehicle goes above. Do you think it's possible ?
Thank you in advance :)
Answer by ShadyProductions · Aug 02, 2017 at 01:24 PM
See if the vehicle's position's distance from the checkpoint is smaller than a given distance, then you can trigger check. That's how most games do it.
https://docs.unity3d.com/ScriptReference/Vector3.Distance.html
Your answer
Follow this Question
Related Questions
Ad Callback 0 Answers
VR Disable Camera rotation / tracking 0 Answers
SteamVR 2.3 - Vive controllers aren't tracking after scene load 1 Answer
A.I That tracks the player then resets 1 Answer
Loading level and DontDestroyOnLoad 1 Answer