Search Unity

Triggers vs Simple Maths of calculating distance.

Discussion in 'Physics' started by sanmeet_puzzlecats, Aug 16, 2019.


Triggers vs Simple Maths of calculating distance.

  1. Triggers

    1 vote(s)
  2. Maths

    1 vote(s)
  1. sanmeet_puzzlecats


    Jul 30, 2019
    Hey, I am developing a car game in which I have a traffic system which moves traffic cars through out the map.
    Traffic system moves cars with logic of Distance. If the traffic cars are in range of Player car then they start moving, it is done by calculating distance every frame. By far it is not lagging.
    But I am still thinking of some alternates.

    1 alternative will be to use a big sphere/box collider on player's car and if OnTriggerEnter/Exit should be used to move and stop traffic cars.

    Will it be a good shot to implement it or it will just be a time waste.

    Other suggestions are also welcome.