I was wondering if there was a way to implement clicking on a static mesh or even a volume and making my character (in first person) walk to a target or mesh.
I am making a first person click to move horror game set in my house in the woods
I want the navigation to be so that points of interest will highlight on mouseover and if you click on them the character/camera will âwalkâ to that location.
I know how to set actor location and rotation on click event but it just teleports me there.
I can do it by triggering a matinee but I think it looks a bit strange (and over complicated).
Any advice will be very very appreciated as I have been stuck on this for a long time.
Thankyou very much for the response! I will try that when I get home.
Iâm new ue4 and wasnât even aware of a navmesh yet hehe.
Although I did try the âsimple walk toâŚâ but it wouldnât accept my player pawn or player character or payer controller inputs, I thought simple walk to was just for AI pawns?
Check out the top-down starter set. It uses the âSimple Move to Locationâ node for movement
The input is the âplayer controllerâ. Just put a âreference to selfâ in as controller inside of your player controller and remember that it will only work in areas which have a navmesh. If you place a âRecastNavMeshâ inside of your level you can make the navigation area visible by pressing âPâ.
I still cant get any of those to work (using the navmesh and building the same input as the top down mode) and have tried many variables. Is it because I donât have âa characterâ? Well technically my character is âPlayerâ which I set up with just mouse yaw and pitch axis movements (to look around) as I have used game mode override. Also with the navmesh, should I be seeing green bounds on my floor during editing (doing all this in a house with floors made from box brush).
I have been able to get my player to move around using matinee and then setting actor location with the target as Get Player Pawn and then a set rotation node with target as Get Player Controller, with the goal connected to a static mesh set to invisible during play⌠where-ever i set the mesh and how I rotate it is how the player will arrive.
But I really want the character to walk there like you said with pathfinding⌠will it not work if I donât actually have a running physical model as my character?
Also can I use the simple move to location node in the level blueprint like I did with the matinee and set actor location to move my character to a location defined by an object initiated by a click event such as clicking on an object of interest.
My goal is to basically have points of interest and clicking on them will walk the player there.
Simple really Iâm sure but Iâm quite stuck hehe. REALLY hope you can help me out and thanks for pointing me in the right direction already, feels so close but just missing something.
Thanks!
You donât need a real character model. You have something with a location in your world. Thatâs all you need.
Iâll take a look at it later today and see how I got it working
And the interp functions take âdelta timeâ, a variable which you get from event tick or from âget delta timeâ and basically is the time in seconds since the last tick and interp speed which is how fast it should go from location to target. Play a bit around with this one but the correct number should be around 1-10.
Alright stupid me. You need to select âAI Controllerâ as AI Controller class for your character. Just a very basic class and you can write your own if you see the need eventually but it totally works with the standard one selected.
It is still using the player controller for input and everything but if AI stuff happens (i.e. pathfinding) it falls back to that one.
I got âset actor location with vinterp toâ to work in the player controller, but it means i need to hold down the mouse button. still cant get the simple move to location to work and the ai controller is set to ai controller.
the blueprint i had in the level blueprint to click on an object and move to taht object is almost working with the vinterp to, i have set it up the same way basically as the blueprint in player controller except that it seems to read the event tick and speed differently⌠instead of moving smoothly accross it just jumps in increments and the increments will be farther or shjorter depending on what âspeedâ it is set to.
ok the move to object has been solved, I put a gate inbetween event tick set actor location, and put the on event click for object at the gate toggle node.
I still canât get the simple move to location to work but I pretty much got it to where I want for now⌠although the way I have it there is no navigation, the character will just move through objects⌠and the pawn doesnât ârunâ.
The set actor location way I wont be able to set-up walking sound either it seems⌠and I would really like a camera-bob.
My fps if itâs still relevent is about 80.
And Iâm pretty sure my âplayerâ extension is character as it says parent class character⌠is that right?
Just want you to know your help has been much appreciated, and I hope this thread will be of help to others in the future too.
I will attach what I have so far.
Do you know if there is a way to make the camera bob up and down?
I have a sound queue now so all I need is that and probably atleast for the time being that might be enough.