Interpolate question

beefy_clyrobeefy_clyro Member Posts: 5,394
edited November -1 in Working with GS (Mac)
Hi. Im currently trying to use interpolate at the moment and am not getting it working how i would like. If you can imagine, i have a cannon in the centre of my screen, it fires a ball directly up and then i would like it to go to 1 of 6 places on the bottom of my screen. The only way i have currently got it going is to use interpolate to move to the 1st location with a 1 second duration, after a second the ball then goes to 1 of its 6 locations based on an attribute that changes 'randomly'. i.e. if game.ballposition = 1 then it goes to 1 location etc etc
Now the problem i have is if the 1st ball is still live, it moves to the next location when the game.ballposition attribute is changed. The second problem i have is its not smooth enough yet, its a bit to 'straight lined' if that makes sense? If anyone could help with making this better it would be much appreciated.

Thanks

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    For smoothing, use the ease in/out option on the interpolate behaviour.

    Experiment and see what works best for you on that.

    Cheers,

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Thanks QS, i'll have a play with that. Any ideas on a better way to decide where the ball goes? currently using a game attribute isnt the best way, unless i can expand on it? If i have 1 ball come out and it goes to a point based on the game attributes value its fine, if a 2nd ball comes out and the game attribute has changed, then both the old ball and the new ball shoot off to the new location. Ideally i want a way that a ball comes out, references the game attribute to find its location and goes there, once its there it doesnt move again even if a new ball is spawned upon a different value and location. Thanks for any thoughts
Sign In or Register to comment.