global last_mouse_click_x;
global last_mouse_click_y;
on "LeftClick"
{
last_mouse_click_x=Scene.MouseX;
last_mouse_click_y=Scene.Mousey;
actor.GoTo(last_mouse_click_x, last_mouse_click_y);
}
Why it's not working? Please help me.
I'm not a great scripter, but the only thing I can see that is maybe wrong is that the Scene.MouseY has the Y in lowecase, whereas the Scene.MouseX is in uppercase. Since your original code worked fine, I would say try just making Scene.MouseY with an uppercase Y. I don't know if this will help or even if the methods are case sensitive, but it's always worth a try. Maybe someone else knows why it's not working?
The best way to troubleshoot this sort of thing is to write the values of the variables out in game.msg and see what is in each variable. If X is ok, but Y is not, then you know the Y variable is not being given a value, which is usually attributed to a typographical error. Good luck.