Add multiple ints to a string line.

So heres the code i was trying to do.

Notifier.GetComponent <Text>().text = ("Saved " + (minersDone.ToString) + " / " + (minersTotal.ToString) + " Villagers");

that didnt work out too well, but i figure it would be an easy fix.

it gave me this error message.

Assets/QuestHandler.cs(156,63): error CS0019: Operator +' cannot be applied to operands of type string’ and `method group’

if someone knows the quick fix please let me know, im sure its really simple; at least i hope it is.

Thank you for your time!

I get stuck with that error all the time because I always forget one thing with ToString. It’s a method which means it needs to be ToString().

 Notifier.GetComponent <Text>().text = ("Saved " + (minersDone.ToString()) + " / " + (minersTotal.ToString()) + " Villagers");

Should do the trick for ya. Good luck :slight_smile:

First of all, using ToString() in this case shouldn’t be needed, Unity does that automatically. Furthermore, try using ToString() instead of ToString.