Click 2 move / Point and click

Hey,

Today is the day that i didnt have anything to do.
Sooo i made you a simple but effective click to move / point and click setup.

What does it do?

  • you click somewhere with your mouse and the player walks to it.
  • you can also use WSAD (not build in, ive build 1 keyboard actuator in it with all keys(just to see if it works, and for you to see how too make the WSAD)
  • it navigates through a navmesh, but this is not needed, just put the steering actuator at seeking and u can remove the navmesh.
  • the waypoint is not added everytime you click, but i made it that you just move the waypoint through out the whole game.
  • u can click and drag the waypoint, to disable this option just turn off the true pulse from the mouse actuator (then u cant drag it anymore).

This click2move is made out of logic bricks, and 1 script to define the click position.

The blend (bge/upbge):
click to move.blend (637 KB)

I hope you like it.
Cotax

1 Like

Cool! Thanks cotax!

Thanks Cotax. That’s cool!

Awesome! :yes:

I have a small question. How can I make it stop at the waypoint and not drift past it?

the drifting is becouse of te steering actuator, u can increse the material friction or select the waypoint and turn of the ghost mode in the physics tab.

ghost mode is enebled for the aswd function, if u turn of ghost mode player will collide with the waypoint.

Ever checkout navmesh.findPath()

you can remove steering actuator, and use custom behavior

At the time when i made this script/setup, no. I even hear it now for the first time i always used the brick, thanks for the info.