Picking only works on the mesh and not the body.
So in your case you try to add a force to a mesh.
This function will return the model/body of your picked mesh:
TModel GetMeshModel(TEntity _Entity)
{
string strClassname;
while (_Entity != NULL)
{
strClassname = GetEntityKey(_Entity, "class");
if (strClassname == "Model")
{
return _Entity;
}
_Entity = GetParent(_Entity);
}
return NULL;
};
Then you can pick your entity like that:
TEntity GetPickedEntity(TEntity _Entity, float _fRange, TPick& _PickData)
{
TEntity ReturnEntity = NULL;
if (EntityPick (&_PickData, _Entity, _fRange, 0.01F))
{
ReturnEntity = GetMeshModel(_PickData.entity);
}
return ReturnEntity;
};