Hi folks,
i am working on a project, where character running on rope, 4 ropes are there
sometimes it coming 4th rope by pressing button,but sometimes,it is not coming
4th rope. i am a ttaching screen shot.
code:-
function Update ()
{
for(touch in iPhoneInput.touches) {
if(touch.phase == iPhoneTouchPhase.Began)// isAnimate == false)
{
//isAnimate = true;
//0.083
if(iPhoneInput. GetTouch(0).position.x < 512.0 iPhoneInput. GetTouch(0).position.y <384.0)
{
//isAnimateLJump = true;
//animation. Play(“LJump”);
animation.PlayQueued(“run”, QueueMode.CompleteOthers);
//animation.Stop(“LJump”);
tempPos = transform.position;
//tempPos.x = tempPos.x - 0.115;
tempPos.z = tempPos.z - 0.115686;
if(tempPos.z < -0.04496)
{
tempPos.z = tempPos.z + 0.115686;
//animation.Play(“LJump”);
print(“Move left”);
}
transform.position = tempPos;
}
else if(iPhoneInput. GetTouch(0).position.x > 512.0 iPhoneInput. GetTouch(0).position.y <384.0)
{
//isAnimateRJump = true;
//animation. Play(“RJump”);
animation.PlayQueued(“run”, QueueMode.CompleteOthers);
//animation.Stop(“RJump”);
tempPos = transform.position;
tempPos.z =tempPos.z + 0.115686;
if(tempPos.z > 0.302093 + 0.115686)
{
tempPos.z = tempPos.z - 0.115686;
print(“Move Right”);
}
transform.position = tempPos;
}
else if(iPhoneInput. GetTouch(0).position.y > 384.0)
{
//isAnimateUJump = true;
//animation. Play(“UJump”);
animation.PlayQueued(“run”, QueueMode.CompleteOthers);
//animation.Stop(“UJump”);
// tempPos = transform.position;
// tempPos.y =tempPos.y + 0.081F;
// transform.position = tempPos;
}
//break;
}
else
{
//isAnimate = false;
//animation. CrossFade(“run”);
}
}
}