If Key Pressed, Then Lerp Position - isn't following through

0 favourites
  • 3 posts
From the Asset Store
Random Maze Generator with Door & Key System - tutorial capx
  • hi!

    Seemingly simple issue here...

    Object doesn't lerp fully as it should and instead moves tiny bit once per time i keypress.

    If i lerp it with a condition checking distance or something that continues True, the object will do what I intend getting the full movement action. I just can't place a trigger anywhere within it. help

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • lepr like that is supposed to be run continuously, on every tick.

    "On key pressed" is a triggered event, it happens once, that's why your object only moves a tiny bit. Besides, you must use dt in lerp expression if you want it to work correctly at different framerates.

    You can change your code like this:

    On Q pressed: Set Action to true
    
    System is Action: dot set position to (lerp.....
    

    But you also need the way to stop the lerp when the dot reaches the player, otherwise it will be chasing it forever.

    I suggest using MoveTo or Tween behavior instead, it will be much easier.

  • thanks. okay i will give it a go! i want to ask more questions but i will try to achieve what i can for now.

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