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
72
S
39
G
37
Posts: 121
Reputation: 24,708

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
52
S
21
G
94
Posts: 2,421
Reputation: 55,530

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
60
S
30
G
133
Posts: 1,942
Reputation: 74,861

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
72
S
39
G
37
Posts: 121
Reputation: 24,708

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
72
S
39
G
37
Posts: 121
Reputation: 24,708


Return to How do I....?

Who is online

Users browsing this forum: PitfallJerry and 1 guest