0 Favourites

How do I Update Pathfinding on mouse move

  • 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..

  • 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.

  • Construct 3

    Buy Construct 3

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

    Buy 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.

    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)
Similar Topics Posts Views Last Post
Unread hot topic
1,941 263,294
FlyingRam's avatar
FlyingRam
Unread hot topic
0 Favourites
CocoonJS plugin updates
519 48,588
tuzke's avatar
tuzke
Unread hot topic
564 105,215
rexrainbow's avatar
rexrainbow