How do I Update Pathfinding on mouse move

Get help using Construct 2

Post » Tue Sep 27, 2016 11:06 pm

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..
"Hello my friend stay a while and listen"
B
62
S
32
G
27
Posts: 81
Reputation: 18,528

Post » Wed Sep 28, 2016 5:50 am

klabundee wrote:I would not like to use every tick..


I know how you can do it...using every tick. :D
B
46
S
16
G
77
Posts: 2,159
Reputation: 45,833

Post » Wed Sep 28, 2016 7:21 am

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.
Mistakes were made.
B
52
S
26
G
108
Posts: 1,606
Reputation: 61,133

Post » Wed Sep 28, 2016 8:00 am

plinkie wrote:
klabundee wrote:I would not like to use every tick..


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


Yeah, I know haha, I just think that every tick is too huge..
Maybe if we have a better pathfinding plugin..
"Hello my friend stay a while and listen"
B
62
S
32
G
27
Posts: 81
Reputation: 18,528

Post » Wed Sep 28, 2016 8:01 am

oosyrag wrote: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.
"Hello my friend stay a while and listen"
B
62
S
32
G
27
Posts: 81
Reputation: 18,528


Return to How do I....?

Who is online

Users browsing this forum: ST314, tarek2 and 33 guests