Japster
Member
Hi guys!
I am having a NIGHTMARE of an issue, trying to work out a dynamically- changing path (my chosen method for this solution, as the marker/path animates, but tbh, I no longer care about animating the damn thing!) - if anyone knows an easier method, I'm all ears!
I even seemed to finally get it working late last night, then it all went to crap again...
Okay, so I was hoping for a path from (in this case, a card), to an enemy (more specifically, to the mouse cursor)...
Like this:-
EDIT:-
This forum is crashing each time I attach the (small) png, so posting first, then adding code and image.... argh!!!
I've seen that paths scale from the centre, so I offset my path, and scaling *looked* like it was working fine, and from the right origin, but with 2 (major) issues....
1) The objects 'walking' the path go absolutely batsh*t crazy when I dynamically change the path scale, like they fall off, fly into space, just generally get confused (and don't come back)...
2)There is (strangely) a delay when changing the scale, in terms of reflecting that on-screen. (So ie. I increase scale 3 times, then try to decrease scale say 4 times, but instead it continues to increase say twice more, THEN decreases, and is constantly playing 'catch-up' after that, in terms of scaling vs. my keypresses or mouse movement?!). This happens even if I use the path_end() etc function, and restart them. They still go crazy, even if I destroy the objects, and re-create them along the newly-scaled path. Pulling my hair out!!!
It also seems that it dynamically scales whatever percentage of it's CURRENT scale, not original. I fixed this by re-copying it from the source one each time, but seems wasteful for CPU resources to do this potentially every frame!
So, I rescale the width - my calculation is showing fine - I it adjusts to a scale of 1 or less/more as expected.
EDIT:-
This forum is crashing each time I attach the (small) png, so posting first, then adding code and image.... argh!!!
I am having a NIGHTMARE of an issue, trying to work out a dynamically- changing path (my chosen method for this solution, as the marker/path animates, but tbh, I no longer care about animating the damn thing!) - if anyone knows an easier method, I'm all ears!
I even seemed to finally get it working late last night, then it all went to crap again...
Okay, so I was hoping for a path from (in this case, a card), to an enemy (more specifically, to the mouse cursor)...
Like this:-
EDIT:-
This forum is crashing each time I attach the (small) png, so posting first, then adding code and image.... argh!!!
I've seen that paths scale from the centre, so I offset my path, and scaling *looked* like it was working fine, and from the right origin, but with 2 (major) issues....
1) The objects 'walking' the path go absolutely batsh*t crazy when I dynamically change the path scale, like they fall off, fly into space, just generally get confused (and don't come back)...
2)There is (strangely) a delay when changing the scale, in terms of reflecting that on-screen. (So ie. I increase scale 3 times, then try to decrease scale say 4 times, but instead it continues to increase say twice more, THEN decreases, and is constantly playing 'catch-up' after that, in terms of scaling vs. my keypresses or mouse movement?!). This happens even if I use the path_end() etc function, and restart them. They still go crazy, even if I destroy the objects, and re-create them along the newly-scaled path. Pulling my hair out!!!
It also seems that it dynamically scales whatever percentage of it's CURRENT scale, not original. I fixed this by re-copying it from the source one each time, but seems wasteful for CPU resources to do this potentially every frame!
So, I rescale the width - my calculation is showing fine - I it adjusts to a scale of 1 or less/more as expected.
EDIT:-
This forum is crashing each time I attach the (small) png, so posting first, then adding code and image.... argh!!!
Last edited: