Interpolate while touching
IsabelleK
Member, Sous Chef Posts: 2,807
Hello,
Could you, please help me with that?
I want to make a rule:
When player is touching the actor, then game.attribute is interpolating, but when player release his finger, then interpolation stops on the current level.
Thank you very much.
Could you, please help me with that?
I want to make a rule:
When player is touching the actor, then game.attribute is interpolating, but when player release his finger, then interpolation stops on the current level.
Thank you very much.
Comments
It has to be something like this:
Player is touching the actor, and this actor is becoming visible, when player release his finger then actor is as visible at it was a second ago (if self.color.alpha was at 0.5 when player realese his finger, this attribute stays at the same level)
Have boolean variable like "turningVisible"
Then set up the rules like so:
if touch is inside
-if turningVisible is true
--constrain attribute: self.color.alpha to self.color.alpha+.01
-otherwise
--constrain attribute: self.color.alpha to self.color.alpha-.01
if self.color.alpha = 0
-turningVisible = true
if self.color.alpha = 1
- turningVisible = false
The first rule checks always that the actor is being touched. If ever released, the alpha value of your actor will remain the same. The second rule is the makeshift interpolator if that makes sense.
Let me know if this helps
-TK
Rule:
When touch is pressed,
Timer: every 0.1 second
Change attribute: self.Color.Alpha to self.Color.Alpha+0.1
Works perfectly!
Thank you very much for help ToastKitten, really appreciate it!