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?
Detecting if a mesh has collided with a sprite?
Blitz3D Forums/Blitz3D Beginners Area/Detecting if a mesh has collided with a sprite? Yes. I know.
Next question?...
.
Next question?...
.
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.
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.
Oh, Thanks. Didn't realise it was that simple. :)