Interpolate Error?
jamie_c
ImagineLabs.rocksMember, PRO Posts: 5,772
@adent42 I think there might be an error somewhere in the Interpolate Behavior. In the project I have attached the screen is overlaid with an actor, after 2 seconds this actor reduces in size and its position should stay locked at the bottom of the screen. But you'll see once the actor begins to resize it jumps up a few pixels and then reduces in size as expected.
The Interpolate Behavior is set to transition over 1 second. If you reduce this time, the amount of pixels the actor jumps is increased and if you increase this time the pixels the actor jumps is decreased. I'm thinking there might be an error in its calculations somewhere?
Comments
Hi Jamie, it's a weird effect, does it look like a bug? But if you need to correct it add a second interpolation
interpolate self position Y to 0 for 1 (or in any case the time you will insert in the first interpolation)
@UltraLionBlu Hi thanks for the tip. It is definitely fixable with additions to the behaviors but it seems like it shouldn't be doing what it does. I can fix it for my needs just wanted to point out a potential bug in case it can be fixed.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
If I use some display text, I can see it's not an interpolate bug, it's a timing bug.
The height is always slightly smaller than the position. It looks like something like this:
loop 1:
height gets smaller
draw
loop 1:
size gets smaller based on loop 1
height gets smaller
draw
That difference between whenever the interpolate executes and then the constrain executes is the cause of the problem.
If you use two interpolates (one for height and one for position), then you get the desired effect.
@adent42, @UltraLionBlu , I'll give it a try. Thanks to you both! :)
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page