GML Visual [SOLVED] Character movement to one clicked point

N

NicolasBahamondes

Guest
Hello everybody! I am Nicolas and I heard about GM:S2 a few days ago, I got in love with the Drag & Drop interface when I tested the product. I wish of creating Point & Click games and I tried tools like AGS, but I got frustrated with the learning curve.

I have a question regarding DnD. I am trying to experiment with a test room in which I try to move a character from one point to another with a mouse click. I tried to make movement possible by calculating the mouse x,y coordinates at the moment of a left click down event, but it doesn't work. Moreover, when I click the character, it goes out flying like a proyectile.

I don't know fairly good yet how should routines be. If you can help me solving this, I'd be eternally glad to.

And hello again! First post in the forum ^u^
 
D

DevNorway

Guest
For me, I just skipped the whole drag & drop section, and went straight into coding. Coding, trust me, makes everything alot easier. Requires less time to learn too!

However. You could create two variables. targetx and targety. Then when you click the mouse button, make your character move towards targetx and targety, with the use of sign().

I know this might seem difficult at first, but I highly suggest to learn the GML. :)
 
N

NicolasBahamondes

Guest
For me, I just skipped the whole drag & drop section, and went straight into coding. Coding, trust me, makes everything alot easier. Requires less time to learn too!

However. You could create two variables. targetx and targety. Then when you click the mouse button, make your character move towards targetx and targety, with the use of sign().

I know this might seem difficult at first, but I highly suggest to learn the GML. :)
I gonna check it through testing, then. Thank you :)

Regarding DnD over GML, I am still overwhelmed on how and where to start learning it. My problem is the lack of vision of how things in a source code are sorted. After I understand the principles of coding, I may shift to GML, but this may take several weeks. D:
 
Top