Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Resolved Switch on string does not output

Discussion in 'Visual Scripting' started by MrMajorThorburn, Oct 21, 2022.

  1. MrMajorThorburn

    MrMajorThorburn

    Joined:
    Dec 15, 2014
    Posts:
    55
    I am following the visual scripting tutorial and have a problem with "switch on string".
    I am at this point in the learning
    learn.unity.com/tutorial/programming-fundamentals-in-visual-scripts
    and when I play my solution I see what is in the screen shot.
    There are no values going out of the switch node even with me holding down the space bar.
    Am I missing something here?
     

    Attached Files:

  2. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    222
    screen shot is too zoomed out to see anything
     
  3. MrMajorThorburn

    MrMajorThorburn

    Joined:
    Dec 15, 2014
    Posts:
    55
    here is a close up.
     

    Attached Files:

  4. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    222
    Ah, looks like you got somthin' going on with the """""W"""""
    no qotes needed, and the Get Input String node outputs a lowercase string
    w,a,s,d, Not W,A,S,D, (depending on your project settings input manager names)
    can also check that Ignore Case checkbox but i assume checking that adds more possessing requests so i always just try and feed it the right string. just a theory and not confirmed

    here is what it should look like in the side part
    Capture.PNG Capture2.PNG
     
    Last edited: Oct 21, 2022
    MrMajorThorburn likes this.
  5. MrMajorThorburn

    MrMajorThorburn

    Joined:
    Dec 15, 2014
    Posts:
    55
    Thank you.
    I had set the values to quoted strings so space was " " s was "s" and w was "w".
    I deleted the connections and the values and re-entered without quotes and all is now working.
     
  6. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    222
    beauty,
    yeah, at first, I was trying to use Quotes as one would in code for a string like that too. lol

    good times