First Person Shooter question

Blitz3D Forums/Blitz3D Beginners Area/First Person Shooter question

He's using a Camera Pick in that example. Basically, it will take the mouse's onscreen position, send an invisible line out and return what it hits. Now, whatever you want to be detectd or collided with, must have been given a pickmode first. Check out EntityPickMode for that.

You can do that for instant hit bullets. Or you can use a line pick. It's like a camera pick, except you define where abouts in 3d space you want it to start from, and the length of the pick. A bit more advanced than camerapick, as faster, as you limiting the length of the pick. The longer the length of the pick, the more time it will take, if it doesn't hit something close.

Just give your enemy a pickmode of 2 i think it is (2 for polygon), and check using PickedEntity() command. This will return the entity "hit" by the pick.

If PickedEntity() = bad_guy then
     ;;;kill bad guy
End If


Whatever you want to happen to the bad guy when he gets shot :o)

The image commands won't help. For bullets the above options are usually best, as blitz doesn't handle two moving entities colliding very well.