How do I Update Pathfinding on mouse move

0 favourites
  • 5 posts
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • Hello guys,

    I'm trying to make an isometric test using mouse + pathfinding, what is happening:

    The movement is working, when I click on some place the player will go there (cool) but if I stay with the left mouse clicked and move around the pathfinding don't update the route, do you know you can I do this?

    I would not like to use every tick..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would not like to use every tick..

    I know how you can do it...using every tick.

  • The exact way to achieve what you asked is to store the mouse x/y values in a variable every tick, and compare the current location of the mouse vs the stored value as a condition before updating the variables with the new values.

    This won't be much different than every tick though.

    A more efficient method would be to have an update event run with the mouse button is down and every x seconds conditions.

  • >

    > I would not like to use every tick..

    >

    I know how you can do it...using every tick.

    Yeah, I know haha, I just think that every tick is too huge..

    Maybe if we have a better pathfinding plugin..

  • The exact way to achieve what you asked is to store the mouse x/y values in a variable every tick, and compare the current location of the mouse vs the stored value as a condition before updating the variables with the new values.

    This won't be much different than every tick though.

    A more efficient method would be to have an update event run with the mouse button is down and every x seconds conditions.

    Yes, I'm working on like you said.

    Thank you.

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