playMaker

Author Topic: Help with if statement && operand  (Read 2197 times)

9TOFRIDAY

  • Playmaker Newbie
  • *
  • Posts: 39
Help with if statement && operand
« on: November 01, 2015, 03:04:17 AM »
Im trying to follow the new tank tutorial on the unity website by re creating it with playmaker and I'm stuck with some logic.

here is an if statement that i just don't know how to translate back into playmaker can anyone please assist me.

if (Mathf.Abs (m_MovementInputValue) < 0.1f && Mathf.Abs (m_TurnInputValue) < 0.1f)

thanks in advance

ManicMinerUK

  • Junior Playmaker
  • **
  • Posts: 51
Re: Help with if statement && operand
« Reply #1 on: November 01, 2015, 08:33:31 PM »
I don't know what the actual code that gets values into those variables does, so if reproducing that part of the script is the problem, you'll need to post that as well... but if the problem is just recreating the "and" part of it, that's fairly simple.

You need to use two states... first state is a float compare, float1 is the variable equivalent to "m_MovementInputValue", float2 is 0.1. On the "less than" event, you transition into the second state.

Second state is the same thing, but for m_TurnInputValue. If that's less than, you can go into a third state that does the playmaker equivalent of whatever the if statement you have posted does.