Cannot retrieve type

Blitz3D SDK Forums/Blitz3D SDK Programming/Cannot retrieve type

'Get entity data
Local myobj:entity = HandleToObject ( bbEntityID( picked ) )


picked is an entity... when I try this code it wont even compile and throws up an error "Unable to convert from 'Object' to entity'"

Any idea what I am doing wrong? I just want to look up the type I associated with the entity using:

bbSetEntityID( e.entity , HandleFromObject( e ) )

What kind of var type is 'entity'? It needs to be a Type for that code to work.

Is this related?
http://www.blitzmax.com/Community/posts.php?topic=70326

Without knowing what type Entity is, You usually have to explicitly cast to your type from any function which returns an object.

So you might try

Local myobj:entity = entity( HandleToObject ( bbEntityID( picked ) ) )


Thank you Gabriel that seems to be the issue. Docs are very vague, probably would not have hurt to have had one example line showing it.