I'm using the space.reycast, all the objects in my space are entities, but the rayCastResult returns the entry the ray hits. I want to know which entity the ray hits so i can deal with it
Or
Is there any way easy to know which entity the ray hits?
can i convert an entry to an entity
Re: can i convert an entry to an entity
Every entity has a CollisionInformation property, which returns an EntityCollidable object. The EntityCollidable object is the entity's proxy in the broad phase and collision detection pipeline. The EntityCollidable is a BroadPhaseEntry.
So, you can attempt to cast the BroadPhaseEntry retrieved from a ray cast to an EntityCollidable. If it succeeds, you can check the EntityCollidable's Entity property to get the entity that owns the collidable.
So, you can attempt to cast the BroadPhaseEntry retrieved from a ray cast to an EntityCollidable. If it succeeds, you can check the EntityCollidable's Entity property to get the entity that owns the collidable.
Re: can i convert an entry to an entity
thank you, that helps a lot