Character/Vehicle

Blitz3D Forums/Blitz3D Beginners Area/Character/Vehicle

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

well, maybe the char are further away than "1" from the vehicle? Run the code in debug mode, and add the line

debuglog "distance:" + entitydistance(char,vehicle1)

also change your if to:

If KeyDown(32) Then 
   If EntityDistance (char,VEHICLE1)<1 then
      ; do your stuff here
   end if
end if


why? because entitydistance takes time - of course on a simple example it wouldn't matter, but if you do several calls on every loop, things will slow down.

So changing the If's you'll only check when the user press the apropriate key, instead of checking all the time...