I have a scene with player and zombie mesh , zombie has Physix controller, i can run the game fine.
I made this code.
- Code: Select all
moveMaxSpeed = 50
obj = 0;
randomX = 0 ;
randomY = 0;
function onInit(objID)
obj = objID;
--character.setJumpDownforce(obj,850);
character.setGravity(obj, 0, -10, 0);
initialPos = newType.vec3(entity.getPosition(obj));
randomX = math.random(1,5);
randomY = math.random(1,5);
newPosition = newType.vec3(entity.getPosition(obj));
newPosition.x= newPosition.x + randomX ;
newPosition.y = newPosition.y + randomX ;
end
function onUpdate( td )
moveSpd = moveMaxSpeed;
character.move(obj, moveSpd );
end
If i add this script as external file the editor crash
But if i add it as micro script the editor does not crash ?
What is the problem with external scripts ?