Custom Player Movement

I’m trying to get the player to walk to the location that I click on with my cursor. I am looking down at the player from a top down view. I know the world coordinate of where the cursor is clicking and also the angles of which the player would look in when going to that location; I’m just unsure how to use all of this with the move functions as I never used them before.

Bump, seriously stuck on this. Any help at all would be great; I just don’t know where to start.

If you get him looking at the spot, try running the +forward console command and when he gets near-enough to the spot it runs -forward.

Just try experimenting with that.

To get him looking at the spot as well, you could use +left and -left, as well as +right and -right in the console. ( I think left and right are it, and if not, they’re strafe. )

I was really over thinking this; I’ll use the whole +/- forward thing right now. Also to get him looking at the location i can just set eye angles.

When you finish this project, I’d love to take a look at it. :smile:

Thanks for the help bud, it works like a charm! I just now gotta figure out a way to map around a building if I click on the other side of one, I suppose I could do a trace from the position I am at to the point that I click at and if it hits something in between I need to somehow figure a way around it. Also the project is pretty big and will probably take a good while, but certainly if I do finish.

I’m having a little bit of trouble of disallowing movement that isn’t done with the mouse… So pretty much not allowing any WASD movement. I saw a few things on the SetButtons() function. However I’m not sure that would work since I use the +forward command and that lists IN_FORWARD as one of the button with GetButtons()