Announcement

Collapse
No announcement yet.

Found a way to make a 'Pure' switch - sort of.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Found a way to make a 'Pure' switch - sort of.

    Hi, I've just worked this out and wanted to share it!

    This might be common practice or obvious to some people, but for me it's going to revolutionise the way I blueprint!

    I hate making temporary variables for transforms and other values - I always wanted there to be some kind of bool switch for variables. In this example I have 2 target transforms for an object in my game. Before this revelation I had my 2 targets as transform vars - when it came to choosing which one I wanted based on a bool, i'd set a new temporary transform var to one or the other of these.

    I could have forked my exec path to 2 duplicate paths with one or the other, but it's not neat to do that - enter the Lerp! Using a bool converted to a float I can put my 2 vars into a transform lerper and effectively have a 'pure' switcher to select one or the other without any messyness!

    Click image for larger version

Name:	BoolSwitch.jpg
Views:	1
Size:	295.4 KB
ID:	1169677

    Yay!

    #2
    Why not use built-in select? It automatically sets types of inputs based on where output is connected. And it automatically sets type of 'Index' depending on what you plug into it..

    Click image for larger version

Name:	BuiltInSelect.JPG
Views:	1
Size:	62.5 KB
ID:	1098054
    • Follow me on twitter
    • Visit our website traverse.world
    • Checkout our game's forum thread

    Comment


      #3
      Bum - and because that's too short to post... Bums.

      Comment


        #4
        God, i'm such a div! I've just found all of the select nodes. Can any of these switch more than 2 options?

        Comment


          #5
          yes, its called SWITCH
          on %enum name
          or on int, string, name

          Comment


            #6
            If you run Integer into Select, you can add option pins with right click:

            Click image for larger version

Name:	SelectOnInt.jpg
Views:	1
Size:	85.7 KB
ID:	1098056

            If you get enum (or custom enum) and create select from it, it will already populate options for you:

            Click image for larger version

Name:	SelectOnEnum.JPG
Views:	1
Size:	50.0 KB
ID:	1098057
            • Follow me on twitter
            • Visit our website traverse.world
            • Checkout our game's forum thread

            Comment


              #7
              That's cool - thanks for the info, i didn't spot the add option pin.

              Comment


                #8
                xulture, I had no idea you could add pins to select node . Thanks for sharing
                HeadsAndBrains
                MARKETPLACE | YouTube

                Comment

                Working...
                X