Profile image

help, i do not get it

89.1k winterro  1.3 years ago

So i was coding in simpleplanes (variables, when i tried to make my walker go back to idle position, forwards : Pitch ? 1 : 0 works, but -Pitch ? 1 : 0 somehow does not ,can someone explain why the latter one does not work?

I made a label and a beacon to test both workings, the positive ones work, the negatives do not

  • Log in to leave a comment
  • Profile image
    89.1k winterro

    Pitch ? -1 : 0 was tried too

    Pinned 1.3 years ago
  • Profile image
    1,219 Novaxomix

    The beginning of your argument is an equation, it needs to be Boolean, replace your -Pitch with !Pitch

    +1 1.3 years ago
  • Profile image

    @winterro
    I may have edited the message after you commented, so I recommend checking again?

    +1 1.3 years ago
  • Profile image
    89.1k winterro

    @ZeroWithSlashedO yeah, that does not work, if it was so easy, I would not be here

    +1 1.3 years ago
  • Profile image

    because, I guess Pitch works for both directions?
    because whenever or whatever value Pitch is inputted, the boolean for Pitch is set to True
    or in other words, whenever Pitch is not 0, the boolean will be set to True

    In the case of what you're trying to do, you can use the ">" or "<" signs so that it only activates on one direction instead of both

    for example, Pitch>0 ? 1 : 0
    this code will only turn whatever it is you're putting it in to 1 when you pitch down
    and Pitch<0 ? 1 : 0 does the same thing, but it requires an opposite action

    +1 1.3 years ago