Getinput + IF

Updated on May 17, 2018 in [A] Unity Scripting
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
5 on May 17, 2018

Hey

i have a script where i get the text inout of a player… But how can i put this in a “if” (see screenshot)

 

Screenshot:

https://ibb.co/hCht8y

i hope i can get a good answer 🙂

  • Liked by
Reply
1 on May 17, 2018

You don’t have a variable for name so name can’t equal anything because it doesn’t exist.

on May 17, 2018

How do i make a variable of it?

 

Show more replies
  • Liked by
Reply
Cancel
2 on May 17, 2018

public string name;

on May 17, 2018

How do i need to add that into my script? 😀

 

on May 17, 2018

never mind

i really appreciate your help, thanks!

it works now

 

Show more replies
  • Liked by
Reply
Cancel