Pathfinding and Rotating

Get help using Construct 2

Post » Tue Mar 05, 2013 9:46 pm

sprite.x=sprite.lastx
Mistakes were made.
B
37
S
17
G
67
Posts: 1,041
Reputation: 38,211

Post » Tue Mar 05, 2013 9:50 pm

Yeah I did...

Sprite.X=Sprite.lastx      Sprite Rotate 1 degrees towards 0

But no success.

Dan
B
8
S
1
Posts: 65
Reputation: 1,108

Post » Wed Mar 06, 2013 12:55 am

Just got back to a workstation with Construct. Here is a capx:
https://www.dropbox.com/s/qz8hhfaayy4z3dv/movementbasedorientation.capx?m
Mistakes were made.
B
37
S
17
G
67
Posts: 1,041
Reputation: 38,211

Post » Wed Mar 06, 2013 1:30 am

That's so generous of you. Thank you very much. I tried that structure on my project but it still doesn't straighten when not going left or rights. Maybe it's got something to do with the followpath event.

I kind of got it to straighten by using the events:

Sprite TargetAngle = 20             Sprite Set TargetAngle to 0
Sprite LastY < Sprite.Y

Sprite TargetAngle = -20             Sprite Set TargetAngle to 0
Sprite LastY > Sprite.Y

It still doesn't work properly though, it doesn't straighten in some places and doesn't rotate it some places.

Thanks again for your help though, I appreciate it.

Dan
B
8
S
1
Posts: 65
Reputation: 1,108

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests