Fluury
Member
Heya!
I've got an issue I need to deal with, but sadly can't put my finger on on how to tackle it.
I have a path made up of several points. For each of these points, I sometimes spawn an instance on the exact x/y of said point. This works fine.
When the player enters the range of the instance, I'd like the Instance to follow the *absolute* path starting from it's current position. For example, if we had a path made up of 5 points, and I happen to spawn an instance at point 2, I'd like the instance to follow the absolute path starting from point 2 rather than the beginning.
A basic look into the documentation made me familiar with the path_position variable, unfortunately it isn't exactly fit for what I need given it is a normalized value.
Each of the instances are aware at which point in the path they were spawned.
My current, crusty way of doing this is the following:
This... I guess gives you a very rough idea of where you are, but obviously does not give you the exact position sadly.
If anyone has any ideas or pointers, I'd love to hear them as I've been struggling with fixing this for a while now.
I've got an issue I need to deal with, but sadly can't put my finger on on how to tackle it.
I have a path made up of several points. For each of these points, I sometimes spawn an instance on the exact x/y of said point. This works fine.
When the player enters the range of the instance, I'd like the Instance to follow the *absolute* path starting from it's current position. For example, if we had a path made up of 5 points, and I happen to spawn an instance at point 2, I'd like the instance to follow the absolute path starting from point 2 rather than the beginning.
A basic look into the documentation made me familiar with the path_position variable, unfortunately it isn't exactly fit for what I need given it is a normalized value.
Each of the instances are aware at which point in the path they were spawned.
My current, crusty way of doing this is the following:
Code:
path_start(global.level_path,pspeed,path_action_stop,true);
var path_pos = my_path_point/(path_get_number(global.level_path));
path_position = path_pos;
If anyone has any ideas or pointers, I'd love to hear them as I've been struggling with fixing this for a while now.