(solved)Effect value animation with lerp and without lerp

0 favourites
  • 10 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • I tried to made one sprite slowly tween to grayscale, but even i have put the lerp values correclty (i think so) it won't work. So I'm again stuck with this and cannot find working clear enough tutorial for it.

  • At least one parameter in your lerp expression needs to change (so either vary the starting value (set it to the current value for example) or modulate the last value). The way you have set it up now, it will stay at 50.

  • Okay, then i have not understood the lerp correctly. I thought that the first value is 0, second value is 100 and 0.5 is the time it takes for the tween between those two values. Now i have no idea what those values actually are.

    How should i change that then?

  • Lerp calculates like this:

    lerp(a, b, c) = c * (b - a) + a

    ashley posted something about lerping with dt:

    https://www.scirra.com/blog/ashley/17/u ... delta-time

  • Dang, it feels so stupid and unnecessary to use this kind of maths for one very simple task... They really need to develop this program further, so this kind of stuff would be history and everybody would laugh to what we needed to do in past...

    I'm very familiar with programs that uses some key framing techniques (3d-modeling, animation, video editing etc.) , but construct 2 don't know those basic tricks and it makes the game development very much slower in this kind of situations that I know it would've be.

  • is for you, then

    "You can also control effect's parameter with LiteTween if you use this behavior by rex_rainbow.

    Tween2Effect by rex_rainbow "

  • What are "a", "b" and "c"? My language is not advanced enough that i could understand it very well from that blog. Thants why im asking silly questions here on forum.. :/

    This is what i get:

    Deltatime is the time that you need to get the finished frame. But i don't know what of those a, b or c is dt, so I don't know how should i use that info. Also I don't know about the other values or even the reason why should i use that function for this tween effect.

    I did not found Tween2Effect and LiteTween very useful either. Lack of documentation made them hard to use and i did not get how to made them working in my case. (i did not found my effect from the list of "tween2effect"

    Here is what i tried to do, but it did not work:

    Actually i found a video tutorial for Unity 3d, that made lerp more clear for me than this blog tutorial i saw earlier in C2 site. Here is the Unity tutorial:

    Subscribe to Construct videos now

    So I almost get it, but still. ah..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • thank you very very much!

    Here is picture of korbaaach solution that works very well:

  • Ok, I did finally do it WITHOUT using lerp at all. If somebody is interested, here is my solution:

    I don't know how stupid or wise my solution is, but it works. Now when my block has been sleeping 15 seconds, it will add every 0.01 second 1 to gray number variable and at the same time it will change grayScale effect parameter to that variable.

    Now i just need to re do this to all of my different sprites that need to have this feature.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)