How to get the name of an collided entity ?

Blitz3D Forums/Blitz3D Programming/How to get the name of an collided entity ?

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.

Turn Debug Enabled on (Program->Debug Enabled) With this enabled, the errors are more specific.
When there is no collision, EntityCollided() will be zero.
Using EntityName$(0) will give a 'entity does not exist' error.
The solution would be checking EntityCollided first:
If EntityCollided(player, 2) then
After that, use
For i = 1 to CountCollisions(player)
mesh = CollidedEntity(player, i)
Then you get all the entities that collided. To get their names, use EntityName$(mesh)