Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Basic logic help

Basic logic help

Scheduled Pinned Locked Moved Help and Support
7 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • AcebossA Offline
    AcebossA Offline
    Aceboss
    wrote on last edited by
    #1

    I’m a bit confused over the order of the IF and Boolean behaviours.

    For instance, if I want this logic:

    IF NOT (Collision with Object A OR Collision with Object B)
    Do Something
    ELSE
    Do something else

    Could someone please provide or point me to an example? Thanks

    RobinsonXR 2 Replies Last reply
    0
    • AcebossA Aceboss

      I’m a bit confused over the order of the IF and Boolean behaviours.

      For instance, if I want this logic:

      IF NOT (Collision with Object A OR Collision with Object B)
      Do Something
      ELSE
      Do something else

      Could someone please provide or point me to an example? Thanks

      RobinsonXR Offline
      RobinsonXR Offline
      RobinsonX
      wrote on last edited by RobinsonX
      #2

      @Aceboss The Collision Event behavior is event based and is supposed to be used to trigger behavior(s) when:

      • An object started colliding with another object
      • An object stopped colliding with another object
      • While an object is colliding with another object

      They work like the Started, While and Stopped Touching behaviors. Although, the Boolean behavior is not event based, it's used as a check (outputting 0 or 1) in conjunction with the If behavior (check if equal to 1 or 0).

      AcebossA 1 Reply Last reply
      0
      • AcebossA Aceboss

        I’m a bit confused over the order of the IF and Boolean behaviours.

        For instance, if I want this logic:

        IF NOT (Collision with Object A OR Collision with Object B)
        Do Something
        ELSE
        Do something else

        Could someone please provide or point me to an example? Thanks

        RobinsonXR Offline
        RobinsonXR Offline
        RobinsonX
        wrote on last edited by
        #3

        @Aceboss 09C7A958-A03F-46E0-877F-E5B62F617D6B.jpeg

        Here is an example of what you're trying to do. I have a variable isColliding? and it is set to 1 once A has started colliding with B. It is set back to 0 once A stops colliding with B.

        Now I coded it such that when I start touching the object, it triggers another behavior only if A is not colliding with B.
        You can plug another if behavior under to only trigger when multiple conditions are met. You can also invert the condition by changing Is Equal To to Is Not Equal To.

        1 Reply Last reply
        0
        • RobinsonXR RobinsonX

          @Aceboss The Collision Event behavior is event based and is supposed to be used to trigger behavior(s) when:

          • An object started colliding with another object
          • An object stopped colliding with another object
          • While an object is colliding with another object

          They work like the Started, While and Stopped Touching behaviors. Although, the Boolean behavior is not event based, it's used as a check (outputting 0 or 1) in conjunction with the If behavior (check if equal to 1 or 0).

          AcebossA Offline
          AcebossA Offline
          Aceboss
          wrote on last edited by
          #4

          @RobinsonX

          Thanks. I am gathering there’s no inherent ELSE behaviour for an IF, and if you want to emulate that you’d need to have an “IF (variable) == 1”
          behaviour and another “IF (variable) != 1” behaviour next to it, is that right?

          MurtazaM 1 Reply Last reply
          0
          • AcebossA Aceboss

            @RobinsonX

            Thanks. I am gathering there’s no inherent ELSE behaviour for an IF, and if you want to emulate that you’d need to have an “IF (variable) == 1”
            behaviour and another “IF (variable) != 1” behaviour next to it, is that right?

            MurtazaM Online
            MurtazaM Online
            Murtaza
            Admin
            wrote on last edited by
            #5

            @Aceboss If you add a second if and put it beside the first if. It will snap together and turn into an ELSE

            AcebossA 1 Reply Last reply
            0
            • MurtazaM Murtaza

              @Aceboss If you add a second if and put it beside the first if. It will snap together and turn into an ELSE

              AcebossA Offline
              AcebossA Offline
              Aceboss
              wrote on last edited by
              #6

              @Murtaza Thanks, I must have missed that in the manual, my apologies. It seems though this is an elseif rather than just an else, I guess under the elseif condition I can put something like 0 equals 0 to always force it to true and become an else. Pls advise if I am incorrect.

              RobinsonXR 1 Reply Last reply
              0
              • AcebossA Aceboss

                @Murtaza Thanks, I must have missed that in the manual, my apologies. It seems though this is an elseif rather than just an else, I guess under the elseif condition I can put something like 0 equals 0 to always force it to true and become an else. Pls advise if I am incorrect.

                RobinsonXR Offline
                RobinsonXR Offline
                RobinsonX
                wrote on last edited by
                #7

                @Aceboss Yeah, for an else if, you can make it a condition that's always true so it'll just act like an else.

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Search