My question is simple enough…what am I doing wrong?
I do have a navigation mesh.
Are you using the controller as your player controller?
Yes i made a child player class and have it set up in my game mode bp.
I even have a navigation mesh… If i used the right volume. How do you get it to show up?
Pressing P in the editor should let you see you navmesh and it should be shown as green. Also you made sure that you built it after placing it right?
Also you could try to change that “self” node with a “get player pawn” instead.
still doesn’t work. It is almost like the input event mouse click isn’t getting fired. I have it set up to auto get input.
I am completely stumped, input isn’t firing at all and I know how to set that up.
it’s easy to check if input is working just by connecting the node to a print :P.
But also make sure you’re enabling the mouse input in the begin play event. Just to make sure this is how i did it:
Event BeginPlay -> Show Mouse Cursor -> Enable Mouse Over Events -> Enable Click Events
Or you can activate those in the defaults of your player controller, under the Mouse Interface category (with mouse it’s a bit different than normal inputs).
yea the event isn’t getting fired at all. I even looked at the top down example and everything is set up the same.
I guess the input settings didnt like the “enable mouse for touch events”.
My next question is a little of topic but I would like the player to rotate without jerking to the clicked location. I have "find look at rotation then plugged that into set control rotation. The problem with this is that it jerks to the look at location.
To smothly rotate the player towards one direction you’ll want to use RInterpTo, to interpolate between the actual rotation and the target rotation with the given speed at the given rate.
I know I am missing something but not quite sure what it is. using the RInterpTo it will keep the player from jerking but it only rotates a bit then walks diagonally. When I click behind the player it doesn’t rotate 180.
Post a screenshot of your interp/rotation setup
It will be posted arround 6-7 pm central. At work right now.
As requested here is my interp to
The second image is a function that I made to tidy things up a little, also all of this is in the player controller.
The interp is similar to a lerp, you need to add to a variable for the delta time, not directly using the delta time.
So the delta time on the node is just how long you want it to take to reach? Or are you saying make a variable for delta time? Wouldnt making a variable be the same as just plugging it in?
Oh cr*p! i already tried to answer an it logged me out when i pressed the post button… -.-
Meh… i’ll try to replicate my answer again:
Even with that setup your character will move before reaching the desired rotation, and that’s because everything is in the event tick. You’ll want to make a check and compare the actual rotation that character has against the target rotation and only when it’s equal, proceed to the simple move to location. With this you’ll probably want to tweak you RInterpTo values to speed it up to make it dynamic.
If i go with the branch to check if it is = then it doesnt work at all. I tried setting it up like the top down example which works to a certain point, but if I click behind the character then it turns 180 and walks, however mine still only turns a little. I will look at the top down example more.
Here is an update. When I set everything up like in the example but without the gate connected to tick and just run the exe pin from the input to the move it works fine with the exception of the players goal not being updated. But when I use a gate node and tick it updates but is jerky. I have decided to go this route because it seems the easiest.