Pathfinder direction

Get help using Construct 2

Post » Tue Dec 03, 2013 7:07 pm

I am using pathfinder to move my character in an isometric game. But I need to mirror the character depending on the direction he is walking. Any ideas?
Thiago Rocha
[email protected]
B
17
S
4
G
5
Posts: 41
Reputation: 4,269

Post » Tue Dec 03, 2013 7:21 pm

My game is not isommetric but a point and click, but here is how I did: I had the pathfinding behavior attached to a dummy invisible sprie and the character animation sprite pinned to the dummy, pinned by position only, no rotation. Then for the pathfinding behavior, make sure the "rotate object" property is set to yes.
Then in the event sheet, I test if the dummy is moving along the sprite and as subevent, I test its angle. If it's between -45 and +45, I set the animation to right. if between 46 and 135, animation to bottom. Between 136 and 225, animation to left (or mirrored right), and if between -134 and -46, animation to top.

You can see i in acion here
B
12
S
5
G
2
Posts: 132
Reputation: 2,637

Post » Tue Dec 03, 2013 7:33 pm

I guess that will do the trick. I am already using a dummy sprite to control the character. Thank you so much. =]
Thiago Rocha
[email protected]
B
17
S
4
G
5
Posts: 41
Reputation: 4,269


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests