Комментарии:
I am new to unity and i wanted to know more about multiplayer games,So i just build a multiplayer game,I was planing to make a android version of it. So i included some UI buttons to it. But then i notices that Canvas wont piking the prefabs so i just put the canvas,buttons and event manager as child of the player charecter. It worked but then i see that it wont work as expected when connecting multiple devices. It is only able to control the latest player with latest deveice joined(latest means the last one which joined the game). So can some one help me to solve this ! Thank you
Ответитьtxt.Text = text;
Coming from a web dev background, this really hurts
Good tutorial though
what if i wanted to change the image on the button? with sprite swap the image turns back to the original when you click away from the buton and i want to avoid this
ОтветитьThank you
ОтветитьThanks Bro!
ОтветитьThank you
Ответитьtransform.find = bad shitcode
ОтветитьWhat a pointless video
ОтветитьI don't like that you used Find method but it was still helpful for me so I leave a like
ОтветитьI am a programmer but I am new to unity, TBH how unity UI works is the weirdest thing I've ever seen.
ОтветитьOne gotcha is you need to make sure your scene has a EventSystem - or your button won't work...
ОтветитьWhy does every button tutorial spend most of the time talking about pointless extra crap? So much time wasted on creating a function to change the text of the button, and all I want to know is how to make the button call the function of a script. 8 minute videos wasting my time everywhere and I just want a good 30 seconds of intelligent tutoring.
Ответитьpublic void myButton(int q){
// "q" it is name select different any//
Debug.Log("Hello World" + q);
}
maybe help, if need only multi click effect.
You just saved my life, I used it to change levels like this :
public void WriteText(string LvlName)
{
SceneManager.LoadScene(LvlName);
}
ah yes its always the random unpopular channels that give great, clear and simple answers thanksss
ОтветитьDoesnt work, when i write text i only get text.alignment
ОтветитьThx man! I'm new to unity(Only a week of using it) I tried GameObject but then it has scaling problems, so I though of using buttons. Your tut really rocks!
ОтветитьHim: "Let's be more creative"
Also him: puts 2 after text
Although thanks for the tutorial!
Thanks, this cleared everything up for me.
ОтветитьThank you for this.
I thought creating a button script with Unity would be simple, but it was a mess. This helped clear things up immensely.
nice
ОтветитьIm doing the same you did but kinda have a problem when i write in the script txt.text = text it says a namespace cannot directly contain members such as fields or methods please help!
ОтветитьSettext doesn't appear on buttonhandler. Man i tried so many tutorials and always unity is the one that doesn't work for me. ;-; Someone heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp.
ОтветитьExactly what I was looking for TYVM!
ОтветитьBut what if I want to be able to control the text within a script?
Ответитьit was really useful but how i display a message by cliking that button , sau you click on it and in the top cornner it says "hello"
Ответитьi have a button like fire and i want when player collid the weapon sprite then fire button well enable interactable true else false how can i do this??
ОтветитьOne question is there a way so it would go back to the original text when clicked again.
Ответитьliterally the only person that can answer my question with a straight answer lmfao, thank you!
ОтветитьThe best video, Thanks, now here a plus if you don't understand:
.
public class ButtonListener : MonoBehaviour
{
public void SetText(string text)
{
Text objText = transform.Find("Text").GetComponent<Text>();
objText.text = "Text Content";
//Put here the text that you need in button
}
}
I want it do so when i click it, it emulates clicking the right arrow key for example. How can i do that?
Ответитьhey i have a question why does my On click option, on the function are there's only string name and nothing else
ОтветитьFine... I saw that you explain how to change the text but i wanna know how to loop the changing text. For example, in a button for game dificulty, how can i change the text normal to hard and then to easy and loop this (every time that I press the button)? Thanks!
ОтветитьHi, thank you for the tutorial .
I want to know if I can change the text of button continuously, since it can only change 1 time.
I am stuck in my progress because of a script. when I press button ui, it dissepear everytime but ı cant call it back again. Can anyone help me ? I want to press button and after I disabled him without delay, I want to recall him again in 6 or 7 seconds later. This my script, Thanks for help.
public GameObject Enable_Disable;
public void Enable()
{
Enable_Disable.SetActive(true);
}
public void Disable()
{
Enable_Disable.SetActive(false);
}
Let's be creative: ''New text 2' )))
ОтветитьThank you soooo much very clear and flexible tutorial :D
ОтветитьThanks Jayanam! Awesome video!
ОтветитьYour tuts are the best!
ОтветитьBullShit
ОтветитьThank you so much, Unity interface can be confusing at times, Refered to this video multiple times. You're great
Ответитьcan teach me how to add control car script to buttons on screen ? i mean W-A-S-D to buttons...
ОтветитьThanks bro
ОтветитьWell paced tutorial
ОтветитьIt's not quite clear to name all elements just as "Text". I can't tell them from each other
Ответитьoh my god i was having such an issues with this before and i saw this video. thank you so much! wow, did this help me out so much!
ОтветитьThank you so much !
ОтветитьEine Sekunde geguckt: Lachflash haha Its actually a german guy
Ответить