Does interpolate have a glitch?
MillionairApps
Member Posts: 110
Hello
I use the interpolate behaviour a lot to add nice effects with movement and fading. However I have noticed that it doesn't seem to run a full cycle as its meant to, as of it skips a value or something. For instance, when interpolate an actors image alpha to zero, it tends to go 0.3, 0.2, 0,2 then 0. And it just looks messy, I even tried adjusting the value so it goes into the negatives so the skipping wont be seen, bit still no luck. It's very annoying not being able to make it run smooth. Sort of takes away from the atmosphere. Is this a bug, glitch or have I done something wrong with using the behaviour?
Thanks
I use the interpolate behaviour a lot to add nice effects with movement and fading. However I have noticed that it doesn't seem to run a full cycle as its meant to, as of it skips a value or something. For instance, when interpolate an actors image alpha to zero, it tends to go 0.3, 0.2, 0,2 then 0. And it just looks messy, I even tried adjusting the value so it goes into the negatives so the skipping wont be seen, bit still no luck. It's very annoying not being able to make it run smooth. Sort of takes away from the atmosphere. Is this a bug, glitch or have I done something wrong with using the behaviour?
Thanks
Comments
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
The glitch occurs in the last 10% of the last whole number of your interpolation.
So on an interpolated move from, for example, X=0 pixels to X=1,000 pixels you won't see it (your actor will theoretically skip the last 10% of the last pixel, imperceivable stuff).
But on an alpha channel fade or an audio ramp - where the whole interpolation spans just one number (0 to 1 or 0 to 1) it chops off the last 10%, which you can clearly hear and/or see.
Solution 1) push the glitch outside your working range, example: interpolate from 0 to 1.2 (or 1 to -0.2) - and adjust the time of your interpolate accordingly to allow for it arriving at its intended value early. This method is quick and works fine for most common scenarios, it works with linear interpolations but screws up ease in and ease out - and of course will not work with an interpolate that doesn't end at 1 or 0 (eg: fading to 50% black will not hide the glitch).
Solution 2) hide the interpolation glitch by making it a tiny fraction of a larger number, rather than interpolate from 0 to 1 (or 1 to 0) . . . . interpolate an attribute from 1 to 256 (or whatever value suits your needs) and constrain the alpha channel (or audio volume) to that attribute divided by 256 (or whatever you chose as your higher value). This way involves an extra attribute but allows glitch free ease in and ease out interpolation (and, of course, linear interpolation).
.
It works fine now using the second solution, bit of extra work but atleast it works now.
Cheers
:P