hughrock18
Member
Hello everyone. I appreciate you coming in to check on this thread.
I've been working with GMS1.4 for the longest time, and now GMS2 (for a total of roughly 5 years of working with gamemaker as a whole). In all this time, I've ALWAYS written my own movement code. I've never, once, used the path functions, but had a basic understanding of their operation.
Now, I'm dabbling in paths (more for a complete understanding of the IDE and its intricacies).
My main issue atm is what to do when an instance has completed its path. I check "path_position == 1" to see if an instance is at the end of the path (NOTE: path_endaction = path_action_stop). The if statement returns true and runs code, but it runs the code every step, relentlessly (and i DO mean relentlessly). I can't seem to stop the code from running without starting a new path, moving the instance to a new position along the path (that isn't "1" obviously), or destroying the instance running the path.
My needs are simple. When the instance reaches the end of the path, I want it to stop. I mean not just stop moving on-screen, but i want the path to finish, run a code block, and "vanish".
The "vanish" part is where I'm stuck. The path is still assigned to the instance and therefor constantly registers the instance being at the end of that path. I want the instance to return to the "state" BEFORE assigning it the path (so it would have NO path attached to it).
I feel like there would be some sort of "path_UNassign" function. Surely, i'm missing something.
Any help would be greatly appreciated.
Thank you.
I've been working with GMS1.4 for the longest time, and now GMS2 (for a total of roughly 5 years of working with gamemaker as a whole). In all this time, I've ALWAYS written my own movement code. I've never, once, used the path functions, but had a basic understanding of their operation.
Now, I'm dabbling in paths (more for a complete understanding of the IDE and its intricacies).
My main issue atm is what to do when an instance has completed its path. I check "path_position == 1" to see if an instance is at the end of the path (NOTE: path_endaction = path_action_stop). The if statement returns true and runs code, but it runs the code every step, relentlessly (and i DO mean relentlessly). I can't seem to stop the code from running without starting a new path, moving the instance to a new position along the path (that isn't "1" obviously), or destroying the instance running the path.
My needs are simple. When the instance reaches the end of the path, I want it to stop. I mean not just stop moving on-screen, but i want the path to finish, run a code block, and "vanish".
The "vanish" part is where I'm stuck. The path is still assigned to the instance and therefor constantly registers the instance being at the end of that path. I want the instance to return to the "state" BEFORE assigning it the path (so it would have NO path attached to it).
I feel like there would be some sort of "path_UNassign" function. Surely, i'm missing something.
Any help would be greatly appreciated.
Thank you.