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
68
S
36
G
32
Posts: 87
Reputation: 21,590

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
48
S
19
G
85
Posts: 2,291
Reputation: 50,461

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
55
S
28
G
115
Posts: 1,709
Reputation: 65,116

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
68
S
36
G
32
Posts: 87
Reputation: 21,590

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
68
S
36
G
32
Posts: 87
Reputation: 21,590


Return to How do I....?

Who is online

Users browsing this forum: jrsetti and 10 guests