danni.coy Posted March 18, 2011 Share Posted March 18, 2011 I am using Unigine::getPlayer to get the currently active player This grabs the editor player. Calling player.getName() is fine calling player.getPosition() causes the engine to crash after restarting on engine restart. as does player.getTransform() calling engine.editor.call("controlsGetPosition"); does not cause a crash any clues? Link to comment
serega Posted March 18, 2011 Share Posted March 18, 2011 Try this: Player player = Unigine::getPlayer(); PlayerDummy player_node = node_cast(player); Link to comment
danni.coy Posted March 23, 2011 Author Share Posted March 23, 2011 Try this: Player player = Unigine::getPlayer(); PlayerDummy player_node = node_cast(player); that does give a clue I do that and I get the following. throw() core/unigine.h:158: Assertion: 'engine.world.isNode(node) == 1' Link to comment
danni.coy Posted March 23, 2011 Author Share Posted March 23, 2011 I modified the code in core/scripts/utils.h to the following and it seems to be working so far Player getPlayer() { Player player = engine.editor.getPlayer(); if(player == NULL || !engine.world.isNode(player)) player = engine.game.getPlayer(); return player; } Link to comment
Recommended Posts