Reputation: 35
I simply want to set a room name using input fields and the fact that it can pass the input through as an argument, but this does not seem to work for some reason.
here is the function that is called
here is the output in the console when typing in the field
why does it send in a blank string?
I followed this tutorial: Youtube
Upvotes: 2
Views: 2221
Reputation: 467
It hasn't been explained well but you want to select the top method under dynamic value. If you look at this image, you will see two methods, selecting the bottom (static) one will show the input field as you see but the top (dynamic) one (which is what you want) will show no input field.
Upvotes: 0
Reputation: 35
I worked around this by creating a reference to the text in "SetRoomName" it's not ideal but works
Upvotes: 0
Reputation: 4061
When you add a listener (HostGame.SetRoomName
) you have two sections from which you can choose your functions: Dynamic string
and Static Parameters
. Your function should be in both sections:
SetRoomName
SetRoomName(string)
You have to choose the first one if you want to receive as parameter the input field text. The parameter in the second option is whatever you put in the field below HostGame.SetRoomName
in your first image (in your case blank).
Upvotes: 2