Playmaker Forum
PlayMaker News => General Discussion => Topic started by: sebaslive on February 10, 2015, 10:40:31 AM
-
if(vNewInput.sqrMagnitude < 0.1f)
{
return;
}
I have this return; value and I have no idea what that means, I tried looking it up and my google skills are not up to par these days. How do I get a return in playmaker?
-
What are you trying to do?
The above code just means "If this sqr magnitude is less than 0.1 then drop what you're doing and go back."
-
void Update ()
{
// We are going to read the input every frame
Vector3 vNewInput = new Vector3(Input.GetAxis("Horizontal_R"), Input.GetAxis("Vertical_R"), 0.0f);
// Only do work if meaningful
if(vNewInput.sqrMagnitude < 0.1f)
{
return;
}
I am trying to get a rotating turret from my joystick and I saw that if I comment out that piece of code the turret pops back to position which is what I am missing in playmaker because I got all the other actions working except this one. I don't know how to make it stop in place and not rotate back to position.