The location is randomly chosen by finding a pathnode and then tracing upwards to see if the area above is sufficiently clear:
Code: Select all
if (NodeCount == NavPoint)
{
// Do a trace to find the hit location of the ceiling
endVector = NP.Location + 448 * vect(0,0,1);
hitActor = Trace( hitLocation, hitNormal, endVector , NP.Location, false );
log("Hit Actor :" $hitActor);
if(!hitActor.isA('LevelInfo'))
{
log("Failure, hit :" $hitActor);
If there is enough height then it attempts to spawn the airdrop. However in testing I'm going to need to do an additional circular trace to see if there is enough room for the box to land.
My question is this: would it be more efficient to just create an invisible mesh and attempt to spawn it to see if there is room or is using the tracing function better?