Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Racing AI Revisited: Box Collider Trigger vs Raycast vs ??? - Performance

Discussion in 'Scripting' started by xlr8, Jan 6, 2014.

  1. xlr8

    xlr8

    Joined:
    Jun 10, 2013
    Posts:
    22
    I've so far managed to improve the (now defunct) Gotow Car tutorial to use adjustable waypoints that can slide along the track width. The next step is to add collision avoidance for vehicles.

    In terms of performance, which is a better approach - two box-colliders surrounding each vehicle along perpendicular axes, or a series of raycasts that extend along different angles from the front of the vehicle?
     
  2. mkthGames

    mkthGames

    Joined:
    Aug 2, 2013
    Posts:
    4
    Box colliders are better in terms of performance. Keep in mind that Mesh colliders are not that good as box colliders.