Search Unity

A quick question about raycasts

Discussion in 'Physics' started by nolim, Mar 13, 2015.

  1. nolim

    nolim

    Joined:
    Mar 28, 2014
    Posts:
    22
    Hi,
    I'm writing a space game and my npc ships are using raycasts to avoid collisions with other game objects. Some of the other game objects are kinematic physics objects with non convex mesh colliders (space stations and the like). I'm having to use fairly long raycasts (200-500 units) to give the ships time enough to react to any potential collision , i also only do a raycast every 0.25 seconds per npc ship.
    My question is how badly will long raycasts from multiple ships effect physics performance, and would i be better off finding another solution. I'm using Unity 5 so i'm hoping for good results but would like to know if i'm heading for disaster!
    I'm targeting consoles and desktop computers....
    Thanks in advance for any advice.
    Dave,