Using the canvas plug in I have created an event that allows me to draw a line with the mouse, however I am still having trouble getting the character to follow that path after I have drawn it. I have watched several tutorials and have not gotten the desired effect. I was wondering if there is a way. I am sure it is with path following, but I havent been able to get that to work either.

I have uploaded the capx file. When you play it in the browser, I have the ability to drawy on the screen with the mouse. I have tried to use the path following behavior, with a "wait" condition, but that didn't seem to work. I am thinking itr is because I am using the canvas plug in, but I dont know why other behaviors wouldn't work on a canvas?

Thanks for your time

You do not have the required permissions to view the files attached to this post.

Well, I am using the canvas plug-in. I am able to draw the lines on the screen. Every tick the system creats an object which is my "line" object, from dot 1 to dot 2. I have fixed it now where on left button released, the character will find a path to mouse.x mouse.y. The character gets there fine, but it doesn't follow the exact path. I am thinking it needs to be that the character finds the first "line" object created, follows it, as it hits that object, it destroys it, and the character looks for the next line, and so on, until it reaches the end. I...hope this is making sense.

In a nutshell... the character has to follow the points, and i do have those points on the screen, because they are drawn... but the character does not follow them, he makes his own path to find the end.

Here's a possible way to do it (these aren't actual events, but show my logic)

On reached point: destroy point

Every tick: path to *least recently created* point.

All you need to do then, is track the least recently created point. That's fairly simple to do by giving all the points an instance variable called 'age' or something. Then, whenever a new point is spawned, increase the 'age' of *all* the points.

Oh yes, i follow what you are saying absolutely...but code has a good way of not doing good, even if it sounds right, haha but i will definitely try that! Stay tuned for an update. I have tried using the "line" point, but maybe if i give the line the instance variable, I will try that. Perhaps a global variable would work just as well? hmm...

Okay, I have two sprites, which create a path in between them. This path is called "line 1" The character will find a path just fine, to the two dots... but it will not find a path to "line" I am thinking because there are spo many "line 1's" on the layout, so the character doesn't know which one to go to. I need a way to have each line created have a different name, I think... if that makes sense..

The problem is, there are multiple "line" 's. I have an instance variable for the line called age. I have each time the a line is created it adds 1 to the instance variable age. I guess I need an expression for the character to know, that the first line has instance a different instance variable then the next "line". Maybe I am not just explaining good enough...