Interpolating integers are not being exact...
Hello everybody,
Here is what I want to happen and what I have working:
-a score attribute to be interpolated up when stuff happens
The problem:
-it isn't adding exactly what I want it to add, and it is even random
My rule states: when actor is touched, interpolate game.score to game.score + 50 over 0.5 seconds. I want it to interpolate so it looks cool. Instead of doing +50 every time, it ranges between +250 — + 290.
It's not a big deal, but it's kind of annoying. Any help would be greatly appreciated.
Here is what I want to happen and what I have working:
-a score attribute to be interpolated up when stuff happens
The problem:
-it isn't adding exactly what I want it to add, and it is even random
My rule states: when actor is touched, interpolate game.score to game.score + 50 over 0.5 seconds. I want it to interpolate so it looks cool. Instead of doing +50 every time, it ranges between +250 — + 290.
It's not a big deal, but it's kind of annoying. Any help would be greatly appreciated.
Comments
This happens because interpolate will continue updating its value. So, if you did game.score +50, it'll eventually be 65+timing remaining, and so forth. TSB offers a great vid on how to fix this. http://gshelper.com/?p=197
So create a self attribute -integer- call it "temp score"
Now right before you make the interpolation make:
Change "self.temp score" TO "game.score"
Then interpolate "game.score" TO "self.temp score"+50
That should do the trick
Roy.
Jack McGraw