How do I add something on to a float.


I have had a problem for quite some time and it is the only major problem in my project right now.
After many google searches I still could not find the answer.

I am trying to add points onto my point float.

points = playertransform.position.z;

I have tried things such as points = points += playertransform.position.z but that just made it go up faster.
Any help is appreciated

You probably just want to add the z-position once. You have two alternatives:

  1. points += playertransform.position.z
  2. points = points + playertransform.position.z

Both these approaches do the same thing.