moveTo() command broken ?? (Solved)
by Jack-S- · in iTorque 2D · 10/09/2011 (12:16 pm) · 2 replies
Hi ive been trying to use the moveTo command however it seems it might be broken.
I have tried both the move toward behavior and my own code but none work...
my own code.
function enemyObject::onAddToScene(%this)
{
enemyObject.enableUpdateCallback();
function enemyObject::onUpdate(%this)
{
echo("enemyObject onUpdate has been called");
%enemySpeed = 150.0;
enemyObject.moveTo(playerShip.getPostion(),%enemySpeed, true, true, true, 0.1);
}
I have used both playerShip.position and just playerShip aswell as the above but my object doest want to move...
all physics, collision and callback have been enabled so im wondering if its no longer working if not how would I get an object to move toward my player without this command. I am aware of setPosition() but this is more like teleportation...
I have tried both the move toward behavior and my own code but none work...
my own code.
function enemyObject::onAddToScene(%this)
{
enemyObject.enableUpdateCallback();
function enemyObject::onUpdate(%this)
{
echo("enemyObject onUpdate has been called");
%enemySpeed = 150.0;
enemyObject.moveTo(playerShip.getPostion(),%enemySpeed, true, true, true, 0.1);
}
I have used both playerShip.position and just playerShip aswell as the above but my object doest want to move...
all physics, collision and callback have been enabled so im wondering if its no longer working if not how would I get an object to move toward my player without this command. I am aware of setPosition() but this is more like teleportation...
About the author
Torque Owner Scott Wilson-Billing
MeYuMe