#Sorry not quite sure what is happening here?
1 messages · Page 1 of 1 (latest)
?
What is the screenshot showing?
it changes values of stamina and agility
my bad forgot to remove a y at end of agility
and it set stats
Sorry not sure I'm following, 'stamina' is not a float, it's a class
...
but in ur code it was float
oh my bad
then you can
stamina.baseValue = stamin;
agility.basevalue = agilit;
yeah having to do those all manually is what I'm trying to avoid
Now I understand what you trying to make xd
if I have 30 stats that's 30 lines of basically the same code, which seems unnecessary
use arrays?
Yeah I'm trying to use a list, but accessing the value of the other class is the difficult bit
as I can't seem to link them
you can use getcomponent tho
Not on a class, only on a monobehaviour
GameObject.GetComponent
it's not a GO, it's a basic class
no
you can import from class
public class GetComponentNonPerformantExample : MonoBehaviour
{
void Start()
{
HingeJoint hinge = gameObject.GetComponent("HingeJoint") as HingeJoint;
if (hinge != null)
hinge.useSpring = false;
}
}```
I can't getcomponent on something that isn't a component tho?
oh
I don't know mate
but for me GetComponent works
for classes too
make your class not monobehaviour
this is helpful
oh
between
unity only work with components
I'm just beginner too but I try help others so I learn more