Detecting if a mesh has collided with a sprite?

Blitz3D Forums/Blitz3D Beginners Area/Detecting if a mesh has collided with a sprite?

po(Posted 2004) [#1]
I have a guy(my own mesh) that walks around a terrain and I have items(that are sprites) that he picks up(or is supposed to). I have no idea how to detect if a mesh has collided with a sprite. Anyone know?


WolRon(Posted 2004) [#2]
Yes. I know.

Next question?...














































.


WolRon(Posted 2004) [#3]
Oh, you were expecting more than just a Yes/No response, weren't you?


Have you heard of Collisions?
Since meshes and sprites are both entities and the Collisions command uses entities, you could set up collisions between the two objects, and then use the EntityCollided command to find out what the mesh collided with.

Or, if you prefer, you could use the EntityDistance command and if the distance is small enough then pick up the item.

Or, if you prefer, you could use the EntityPick command and if the item is within range, pick it up.

Or, if you prefer, you could use the LinePick command (with the radius option) and if the item is within range, pick it up.


po(Posted 2004) [#4]
Oh, Thanks. Didn't realise it was that simple. :)