i tried to look for a Function to get the Position from the Player - i know the thing in Torquescript but i need it for the c++ code of Torque 3D.
would be nice if you could tell me
thx and gn8!
Code: Select all
GameConnection* connection = GameConnection::getConnectionToServer();
if( !connection )
//fail with the game. Maybe you haven't started the level. Return an error.
Player* playerObject = dynamic_cast< Player* >( connection->getControlObject() );
//fail. Maybe the control object is a camera or a vehicle not parented to Player
Point3F pos = playerObject->getPosition();