moveTo(), onPositionTarget() not called
by rennie moffat · in iTorque 2D · 09/22/2011 (11:59 am) · 0 replies
Hi there,
I have read multiple threads on onPositionTarget not returning, usually there was some syntax error, I can see none here.
My issue is two fold. I am using $CamView.moveTo(), with the callback of true, for onPositionTarget. However, a. my $CamView is not moving to, depiste my echoes telling me that it is reaching the command. My $CamView object has usesPhyics set to on. ... all my variables, seen in echo are returning yet, a. the $CamView is not moving (**sceneWindow2D is mounted to CamView, but I would think that should make no difference), and b. when I set the CamView to already be in position, it should just accept that as true and forget about the move to, however the program still passes thru.
I know in these past couple of days I have been asking for very trivial help, but this is wierd. I have used moveTo and onPositionTarget() before with great success, so why would it be different here.
Maybe I need to just start a new project... edit. infact I just did with no help.
To boot, the camera mount behavior is still not working. ???
I have read multiple threads on onPositionTarget not returning, usually there was some syntax error, I can see none here.
My issue is two fold. I am using $CamView.moveTo(), with the callback of true, for onPositionTarget. However, a. my $CamView is not moving to, depiste my echoes telling me that it is reaching the command. My $CamView object has usesPhyics set to on. ... all my variables, seen in echo are returning yet, a. the $CamView is not moving (**sceneWindow2D is mounted to CamView, but I would think that should make no difference), and b. when I set the CamView to already be in position, it should just accept that as true and forget about the move to, however the program still passes thru.
I know in these past couple of days I have been asking for very trivial help, but this is wierd. I have used moveTo and onPositionTarget() before with great success, so why would it be different here.
Maybe I need to just start a new project... edit. infact I just did with no help.
To boot, the camera mount behavior is still not working. ???
function manager_gameScene_behavior::moveCamToTop(%this)
{
echo("manager_gameScene_behavior::moveCamToTop");
echo("$CamView.position " @ $CamView.position);
echo("%this.camLoadPos " @ %this.camLoadPos);
if(t2dVectorCompare($CamView.position, %this.camLoadPos))
{
echo("if(t2dVectorCompare($CamView.position == %this.camLoadPos)");
%this.loadObject();
return;
}
echo("else if(t2dVectorCompare($CamView.position != %this.camLoadPos)");
%this.camViewMoving = true;
$CamView.moveTo(%this.camLoadPos.x, %this.camLoadPos.y, %this.camLoadSpeed, true, true, true, 0.1);
echo("%this.camLoadPos.x " @ %this.camLoadPos.x);
echo("%this.camLoadPos.y " @ %this.camLoadPos.y);
echo("%this.camLoadSpeed" @ %this.camLoadSpeed);
return;
}
function manager_gameScene_behavior::onPositionTarget(%this)
{
echo("manager_gameScene_behavior::onPositionTarget");
if(%this.camViewMoving == true)
{
%this.camViewMoving = false;
%this.loadObject();
}
}About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.