Interpolate issue
Ok yet another issue I'm trying to figure out a solution for. I have an obstacle that when overlapped with my character, will cause my character to get very heavy and he will start to fall down the screen. For this I use an interpolate behavior. I also use a game level attribute "game.state" for my main character. So if game.state = 3 then I have the interpolate coding fire and he starts to descend slowly. However when I use a power up he stops being so heavy and the player can now tap him and he will fly as normal. My problem is how to get the interpolate behavior to stop it's interpolation. When I use the power up I have the game.state change to 2 which enables the tapping to resume by the player. But the interpolate is still going through with what I told it which in this case is if game.state = 3 interpolate character to -50 Y with a 5 second interpolation. So when game.state changes t o2 it is still carrying out this command and overrides the ability to tap the character to make him fly. Hope that makes sense.
Comments
It's 'difficult' to stop an interpolate prior to its completion. Search on the forums - I believe there are a few demo files which show you how to cancel interpolates.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@Braydon_SFX ah I see I had no idea. In that case I will just use a different behavior if I can. I won't use interpolate if I don't have to.
Interpolate is my favorite behavior. I use it all of the time. You just have to know when not to use it.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Yeah I like it as well. Guess I still have to find out when not to use it haha
Actually I just changed the character's density which mimicked the interpolation effect and works perfectly. I just put change density and in the otherwise I had it change back to its regular density. Sweet workaround.
Hey @dreichelt,
In a few of my projects I have interpolate running and there is a way to "cancel it" if you will.
Posting an example for you. In the example the actors interpolate position is set to 400 and its duration is set to 400. Once its position x reaches 200 it changes the interpolate set position from 400 to 200 and its duration to 0 which stops it.
Hope this helps!
My above comment might be of some use to you @Braydon_SFX as well and others here on the forums!
@KillerPenguinStudios wow thanks man I will have a look at that!