playMaker

Author Topic: Return;  (Read 1830 times)

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Return;
« on: February 10, 2015, 10:40:31 AM »
Code: [Select]
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?
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Return;
« Reply #1 on: February 10, 2015, 10:42:44 AM »
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."
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Return;
« Reply #2 on: February 10, 2015, 10:51:42 AM »
Code: [Select]
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.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez