How do I use lerp for Zoom ?

0 favourites
  • 3 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hello,

    I checked many tutorials and threads about Lerp so I thought I was ready to use them, but it seems not :P

    I tried to add a Zoom system in my game, it worked when I automate it, but I was trying to manage it with Function, that way :

    But it didn't work, the game just stop at this moment, I guess the problem is the "as long as" (don't know if it's the traduction used in English), or maybe the "dt" not working in a Function?

    Do you think it's possible to had that kind of Zoom Function system that way?

    Thanks a lot!

  • now your function only zooms for one tick. (when the function is called)

    it needs to run until the zoom is finished.

    you could do something like this:

    on function, set local variable zoomTarget to X and speed to X

    (then without it being a subEvent)

    if zoomTarget =/= LayoutScale lerp(LayoutScale,zoomTarget,speed*dt)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're right, that's working thanks a lot!

    I tought it was possible to repeat multiple actions in a function...

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