#When I call GetValue() it returns the basevalues. Not the modifiers added.
1 messages · Page 1 of 1 (latest)
Replace = + with +=. = + means "equals to the positive value of", while += means "increase its own value by".
thanks 😃
I did it but still Getvalue turns basevalue
Have you checked if modifiers were added successfully?
yes I can see them in debug mode
Got it, will have a look
Did you actually do that?
yes?
Share the updated code then
{
int finalValue = baseValue;
modifiers.ForEach(x => finalValue += x);
return finalValue;
}```
That should work
The problem must be somewhere else then. You can confirm it by logging the finalValue before return.
Why is that in the advanced channel btw?😅
I thought it was in general
its a simple problem to say Advanced
Yeah. It is in advanced though.
like this?
Debug.Log(finalValue );
return finalValue;```