Forsooth! My Missile Won't Work

Blitz3D Forums/Blitz3D Beginners Area/Forsooth! My Missile Won't Work

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ace, if you'd copied the code I posted then you wouldn't have had any of these issues!!

See the original function below as I posted it, note the 'Source' instead of 'cam' as a function parameter. When you call the function use 'cam'.

Function GetNearestTarget.Target( Source )

  Local Found.target

  MinDistance# = 100000

  For t.target = Each target
     
    Distance# = EntityDistance( Source , t\Shape )

    If Distance < MinDistance
       MinDistance = Distance
       Found = t
    EndIf

  Next

  Return found

End Function