lerp function not moving object all the way

0 favourites
  • 5 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • So I'm making a visual novel and at the beginning and end of dialogue events the character-sprites and UI elements slide off screen with lerp functions. I'm having issues with the lerp function sometimes working perfectly and sometimes just moving the object partially the way. I've managed to fix it this far but this time I'm defeated. I have a number variable (dialogue_animation_end), if = 1, and if the objects are not in their position then lerp... Every other object has the same code and moves to their destination but not the dialogue bubble.

    The weird thing is that when dialogue starts, I have basically the same code (dialogue_animation_start) and it moves correctly.

    I have a few suspicions.

    1. The UI elements are on their own layout with global layers, and because of that, the lerp function does not work the same as the character sprites that are on the played layout.

    2. The Dialogue bubble moves along the Y axis, and therefore do not work the same.

    I'm gonna be honest I don't think these things makes sense but it's all I got at this point.

    Tagged:

  • Is gonna be impossible for anyone to help you if you dont share a minimal project so other users can have a look at it to find the issue. So if I was me I will create a small demo with the less (code & objects) as possible just with enough code to recreate the issue as no one will go through big chunks of blocks of code trying to understand what's going on.

    For moving UI objects etc... I like to use "MoveTo" Plugin from Rex as it has the trigger when they arrive at the Target position so you can do different stuff like opening new panels etc...

    Though you dont need any plugins as you can replicate it as you do, but it makes it easier as it takes care of everything, you just give target (XY) or (UID) and done, then wait for the trigger to let you know that it arrived to target destination if you need to.

  • Thank you! Sorry, I'll try to make that next time.

    I'm gonna look into that plugin. I also got advised on reddit to use tween and have been looking into that. Have it installed but still figuring out how it works. Which one do you think is better for what I'm doing?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you! Sorry, I'll try to make that next time.

    I'm gonna look into that plugin. I also got advised on reddit to use tween and have been looking into that. Have it installed but still figuring out how it works. Which one do you think is better for what I'm doing?

    Funny I was gonna recommend you that too the "LiteTween"

    Both are really good.

    I use the MoveTo the most but you may find LiteTween more useful as that is not just for moving staff as it is used normally for tween objects.

    MoveTo is my favourite for GamePlay and some UI moving etc... You will see why when you test it.

  • Thanks for for the help!

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