#Variable text

1 messages · Page 1 of 1 (latest)

visual spoke
#

I've got a public variable in a script and I want to print it on a text, but it seems i go around the same errors, and one of them being the name of the variable does not exists

pseudo anchor
#

show the error and your code . . .

visual spoke
#

2 sec

#

the variable

#

bananaPCDisplay being the text

pseudo anchor
visual spoke
#

how do i do it?

pseudo anchor
#

Not sure why you have public global::System.Int32 for though. If it's an int, just do public int BananaPerClick . . .

visual spoke
#

yeah that's what i did first, but vs recomended me doing this and I thought it would do something

#

yeah, bout that

#

did what that guy say, now getting error for "=" or "("

pseudo anchor
#

can't tell what is wrong without the code . . .

visual spoke
#

solved some, but still get the = one

pseudo anchor
#

butonCick does not have a type: <accessor> <type> <fieldName> = <defaultValue> . . .

#

oh, butonClick is the type. you did not give the field a name . . .

visual spoke
#

well now, this is the final error

#

on the final line

pseudo anchor
#

that's incorrect. bananaPerclick is a property of butonClick. you need to reference an instance of butonClick in order to access bananaPerclick . . .

visual spoke
#

that would be a great info if I would know how

pseudo anchor
#

the video describes different ways to do so. much easier to get and see it work than i can type back and forth rn . . .

visual spoke
#

it's kinda hard to rewrite when I have different things that do different things, I will try later and see if it works

visual spoke
#

ok, solved the errors

visual spoke
#

solved the error but nothing happens great

visual spoke
#

it shows the "A" but not the bpc