Interpolate problem
ShortAxe5
Member, PRO Posts: 69
How can I use interpolate to make something go up and down repeatedly on it's own?
I've only been successful in making it go down. I need it do go down AND up and loop that behavior.
Please help me I'm stumped
Comments
Is this what you are after?
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
No. I'm making a flappy bird clone and I want the pipes to move up and down slowly using the interpolate behavior.
Can you help me please?
Maybe using a sin function rather than interpolate would be better. Learned this in calculus so maybe it can be used for something useful for once haha, so i'll give it a try and send you the function if it works
There is an issue when you have two interpolate behaviours running consecutively. The second one conflicts with the first one and it wont fire. Do a search and you should find an answer or maybe someone else and post a link to it.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
I think if you try interpolating the y position to a random value and when it reaches that value just interpolate the height to another random value and so forth? like a loop thing
You could have 2 rules.
Example.
Rule 1
If self.position Y = 160
Interpolate self.position Y to 20
Rule 2
If self.position Y = 20
Interpolate self.position Y to 160
It will just go up and down.
(I'm guessing you mean 'y position'].
If you interpolate an object's position in one direction to a random value - and then in the opposite direction to another random value, then the object has no limits to its travel.
For example, an object interpolating like this, up and down, in a GameSalad project can leave the scene. A simple illustration of this: imagine a random range of 0-100 pixels, the object goes down by 1 pixel, and up by 98 pixels, down by 54, and up by 86, down 7, up 27, down 65, up 100 . . . . etc, it soon leaves the scene.
I'll give it a try. Thanks guys!