Search Unity

How do I make a character name variable to use Fungus?

Discussion in 'Scripting' started by SweetInsanityArts, Feb 3, 2021.

  1. SweetInsanityArts

    SweetInsanityArts

    Joined:
    Jan 30, 2020
    Posts:
    9
    I have a character selection screen with an input field and the name that is entered into that field was supposed to get saved as a variable for Fungus inside a scriptable object ("Werte").

    Code (CSharp):
    1. fc.setStringVariable("PlayerName", Werte.PlayerName);
    I also tried just using setVariable() but neither works, they're both being marked red in Rider without any suggestions for what else I should write.
     
  2. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    The question is a little vague.
    What is "Fungus"? An asset?

    fc.setStringVariable("PlayerName", Werte.PlayerName);

    What is this "fc" object? Where/When is this code executed?

    Without knowing what "fc" is, we can't tell if it even has a "setVariable()" or "setStringVariable()" method.
     
    Terraya likes this.
  3. Terraya

    Terraya

    Joined:
    Mar 8, 2018
    Posts:
    646
    also looking at your "Werte" variable i see that you are german,
    feel free to join and if you got any problems, i do live support :)
    https://discord.gg/vH8zNv9aZ9

    (obv. not only for germans)
     
  4. SweetInsanityArts

    SweetInsanityArts

    Joined:
    Jan 30, 2020
    Posts:
    9
    ah thank you, i will!!
     
  5. SweetInsanityArts

    SweetInsanityArts

    Joined:
    Jan 30, 2020
    Posts:
    9
    Fungus is an Asset that I use for my dialogue and the fc is the Flowchart