PickedEntity()??
Blitz3D Forums/Blitz3D Programming/PickedEntity()??
| ||
I'm sure there must be an obvious answer to this... Strangely, it seems that PickedEntity() returns an integer. What is this number? A memory address? The docs provide no explanation whatsoever. And more to the point, how do I get the entity's handle instead (eg "Cube_01")? Thanks, |
| ||
it's the actual entity. ball = CreateSphere() a = ball a and ball both hold the memory address of the sphere. PickedEntity() will return the last picked entity address using line/camera/entitythingypicky. pickedball = PickedEntity() hideentity pickedball |
| ||
name$=EntityName$(PickedEntity()) |
| ||
Jedive: If you're after the actual HANDLE of the entity then that exactly what PickedEntity will return. It will NOT return the variable which currently holds its handle (as there could be more than one).camera = CreateCamera() cube = CreateCube() Repeat CameraPick camera, MouseX(), MouseY() entity = PickedEntity() If entity <> 0 TurnEntity entity, 1, 1, 1 EndIf RenderWorld Plot MouseX(), MouseY() Flip Until KeyHit(1) |
| ||
Thanks for the replies. Seems I've been misusing/misunderstanding the term 'handle' slightly - apologies for that. But I think I've got it now. |