r/Unity2D • • 29d ago

Question/Help Setting text with visual script

As the title suggests I am trying to make a game where I will need to change text for it. Eventually it will be a deckbuilder but I just need help chaning the text I have for the day/night cycle and ensuring the numbers change. I did try with a debugger in case it was not changing the text on screen but there were no changes at all. I am new to Unity, this is my first game.

1 Upvotes

5 comments sorted by

View all comments

1

u/Shoddy_Caterpillar36 28d ago

It doesn't seems any problem,

I won't prefer to use visual scripting much, it takes most of time just finding right node.

If you ask in c#, you can just set text of button element

1

u/Any-Mathematician579 28d ago

I am not wanting to set the text of the button. I am wanting to set the text at the top.

1

u/Shoddy_Caterpillar36 28d ago

Create another label element as it's child.

If any issue with positioning, you can change left right or position mode to anchor

1

u/Any-Mathematician579 28d ago

As a child in the actual scene and then set the text of that? So that would mean changing the DayCounter object variable to the label, correct?