Pause question

RedRoboRedRobo Member, PRO Posts: 680

I have an actor that rotates once every 6 seconds using interpolate behaviour.
Basically I interpolate to -360 degrees every 6 seconds.
I want to use the Interpolate behaviour because I like the Ease In and Ease Out function as it gives a nice feel.

So the question is, does anyone know of a way to pause and unpause this motion in a way that will have it carry on from where it was? At the moment I can only get it to pause when the Interpolate behaviour has run its current cycle, so it always starts and stops at 0.

Best Answer

  • RThurmanRThurman Posts: 2,879
    Accepted Answer

    You can use attributes in the interpolate behavior's To:[ ] and Duration:[ ] fields.

    When you want the interpolate behavior to stop, change the To:[ ] field to the actor's current rotation, and the Duration:[ ] field to 0. (GameSalad will think it has completed the interpolate behavior.)

Answers

  • RedRoboRedRobo Member, PRO Posts: 680
    edited January 2020

    @RThurman That's a great idea thanks!
    I think I may have a bit of an issue when I up-pause to get the interpolate (Ease in/out) to carry on from where it would have been although I need to try it...might not be noticeable.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    @strag -- Yes, I can see that unpausing the interpolate might be tricky.

    Here is an old thread that shows how to make your own interpolate behavior with the expression editor. It might give you some ideas on how to create your own way of stoping and starting an interpolate.

    https://forums.gamesalad.com/discussion/54962/make-your-own-interpolations/p1

  • RedRoboRedRobo Member, PRO Posts: 680

    @RThurman said:
    @strag -- Yes, I can see that unpausing the interpolate might be tricky.

    Here is an old thread that shows how to make your own interpolate behavior with the expression editor. It might give you some ideas on how to create your own way of stoping and starting an interpolate.

    https://forums.gamesalad.com/discussion/54962/make-your-own-interpolations/p1

    Wow! Couldn't of asked for anyone better to answer my question, the master of interpolation! :D
    To be honest, it's all a bit over my head. I need to study it carefully though as it will be really useful if I can understand it!
    Thanks ;)

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    You are welcome!
    There might be something in that old thread which might be useful.

    As you said, unpausing the interpolate might be a bit tricky. Can you describe what you want the the actor to do when it resumes its rotation? For example, when it resumes the interpolate, does it take a full 6 seconds again? Or do you want to resume with only the remaining time left to reach -360. (The more detail you supply, the easier it will be to figure out what might be done.)

  • RedRoboRedRobo Member, PRO Posts: 680

    @RThurman said:
    You are welcome!
    There might be something in that old thread which might be useful.

    As you said, unpausing the interpolate might be a bit tricky. Can you describe what you want the the actor to do when it resumes its rotation? For example, when it resumes the interpolate, does it take a full 6 seconds again? Or do you want to resume with only the remaining time left to reach -360. (The more detail you supply, the easier it will be to figure out what might be done.)

    Just to be precise; The actor has a timer which is set to repeat every 6 seconds.
    Then within the timer I have an Interpolate behaviour which interpolates self.rotation to -360 degrees over 5 seconds using Ease In/Out function.

    So basically the actor rotates completely in 5 seconds, pauses for a second then does the same again.

    The question about pausing was because I want a pause button to be able to pause the whole game and then resume again. So if it was paused 2 seconds in, when up-paused it would carry on rotating for 3 seconds using the In/Out curve as it would have done if it hadn't been paused. then pause for a second and carry on as before.

    Hope this makes sense :D

Sign In or Register to comment.