• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

GameMaker [SOLVED] path_reverse function

A

Alberto

Guest
I've spent a couple of hours trying to understand what's wrong with path_reverse function or what's wrong with me ;)

I've tested it on GMS1 and GMS2 with the same result. When I use path_reverse I wish only the nodes will change like 0...n -> n...0, but the problem is that the path change its position similar to a mirror effect (with axis in the first node).

You can read on the manual about path_reverse:

"... The actual position of the points remains the same, only the order in which they are processed is changed..."

I want to use this function to make NPC reverse the path in some point, similar to path_action_reverse but not only at the end of the path.

Please, help me. Probably I am making something wrong. I need help.

Thank you all!
 
A

Alberto

Guest
I solved by myself! I'm so happy. The problem was you need to start the path again once you call the path_reverse function and then assign the right position.

Code:
var here = path_position;
path_reverse(pth_country);
path_start(pth_country, 0.5, path_action_reverse, 1);
path_position = 1-here;
 
Top