Why doesnt this work?

Get help using Construct 2

Post » Thu Jun 27, 2013 11:58 pm

Hi,



I want the text box to show the number contained in the variable.

The top line doesnt work but the second one does

Why?
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Fri Jun 28, 2013 12:04 am

Hi spongehammer,
Drop the quotes on the variable

Variable1 instead of "Variable1"

Only strings (of text) get quotes :)Mulkaccino2013-06-28 00:04:28
B
51
S
13
G
8
Posts: 194
Reputation: 7,311

Post » Fri Jun 28, 2013 12:06 am

you should do > set text to str(Variable1)

your var is a number and set text expects a string

also if you use a var, you shouldn't but quotes around it ""


edit: ow i guess you don't even need the str()vtrix2013-06-28 00:09:17
ImageImage
B
65
S
19
G
7
Posts: 814
Reputation: 9,691

Post » Fri Jun 28, 2013 9:06 am

@vtrix

thanks. It does need the str(Variable1) as the textbox is set to a number type.
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180


Return to How do I....?

Who is online

Users browsing this forum: AmpedRobot, KailSaisei, maddy467, TeslaPC and 10 guests