#Static reference

8 messages · Page 1 of 1 (latest)

golden hearth
#

I dont understand that cp variable..

Cannot make a static reference to the non-static field cp

knotty roseBOT
#

This post has been reserved for your question.

Hey @golden hearth! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

raven turret
#

cp is an instance variable there, it's only accessible from an instance of the class, that's what the error is saying
since you're instantiating the class there, you need to get the cp from somewhere

btw, cp is pretty vague as to what it is. something like just pos might be better

golden hearth
#

yeah but how can i set this up so it works

#

the class should not be able to change values

torpid patrol
#

You need to make that info come from somewhere. Clearly the cp variable written that way makes no sense, and isn't somewhere the info could possibly come from.

#

So you need to make the info come from somewhere