Search Unity

Triggers vs Simple Maths of calculating distance.

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

?

Triggers vs Simple Maths of calculating distance.

  1. Triggers

    2 vote(s)
    66.7%
  2. Maths

    1 vote(s)
    33.3%
  1. sanmeet_pc

    sanmeet_pc

    Joined:
    Jul 30, 2019
    Posts:
    2
    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.

    Thanks.