I have a custom "Player" class, inheriting from Game:Chr. I have a ObjMemx container in my main class, and I've done .setObjType(Player, OBJ_PLAYER)
When I retrieve my .obj (type is OBJ_PLAYER), and do .objCreate, everything works fine: My player shows up fine, I can control him, it works.
However: I cannot access him in the Players container. It says it has 1 element inside, which is invalid. How is that possible?
Secondly, if I use .objCreateNear, nothing shows up, nothing happens. I'm creating at the Cam.at, but it doesn't even go in the if-structure.
Code:
// Create the player
EE::Game::ObjParamsPtr playerParams = EE::Game::Objs.ptrGet("obj/chr/human/0.obj");
if (Game::Obj* obj = EE::Game::World.objCreateNear(*playerParams, Matrix(playerParams->scale(), Cam.at))) // create new object at position and give objects default scaling
{
Player* player = CAST(Player, obj);
}