#Variable text
1 messages · Page 1 of 1 (latest)
show the error and your code . . .
BananaPerClick is from the butonClick class. you need a reference to the class in order to access the property . . .
how do i do it?
A few basic ways to get references in Unity.
Directly-
GetComponent 0:38
/GetComponentInChildren
/GetComponentInParent
Public Variable- 3:00
Find- 5:01
Find 5:39 (by name)
FindWithTag 6:14 (by tag)
FindObjectOfType 6:51 (by component)
Interaction- 7:15
OnCollisionEnter
/OnTriggerEnter
Not sure why you have public global::System.Int32 for though. If it's an int, just do public int BananaPerClick . . .
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 "("
can't tell what is wrong without the code . . .
solved some, but still get the = one
butonCick does not have a type: <accessor> <type> <fieldName> = <defaultValue> . . .
oh, butonClick is the type. you did not give the field a name . . .
that's incorrect. bananaPerclick is a property of butonClick. you need to reference an instance of butonClick in order to access bananaPerclick . . .
that would be a great info if I would know how
the video describes different ways to do so. much easier to get and see it work than i can type back and forth rn . . .
it's kinda hard to rewrite when I have different things that do different things, I will try later and see if it works
ok, solved the errors
solved the error but nothing happens great
it shows the "A" but not the bpc