Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Character gets stuck (With Video)

Hello, i'm currently working on an top/down adventure game and I'm having some trouble getting the Jump to work properly.


The issue right now is that the character gets stuck on one of the platforms. As shown in the video these platforms are initially underground and have to be activated through a series of levers. When I try to jump the character gets stuck and i'm not sure why since he doesn't do that on the previous two platforms. I should also mention that if I place the platforms already at their final position in the editor and then play i CAN jump on that platform without issues. So it seems to be an issue caused when the object is animated. Any Ideas how I could solve this?

Thanks. alt text

Product Version: UE 4.21
nav-mesh-2.png (663.6 kB)
more ▼

asked Mar 27 '19 at 11:08 AM in Using UE4

avatar image

26 2 4 9

avatar image OniricMaster Mar 27 '19 at 11:39 AM

Heres a screenshot of the Nav Mesh when the platforms are already raised. ![alt text][1]

I believe I found the error but I'm not sure how to fix I've been playing around with the Nav Mesh settings cant seem to find a solution. Some help would be greatly appreciated. [1]: /storage/temp/272549-nav-mesh-3.png

nav-mesh-3.png (474.6 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Is this an AI character? A player controlled character shouldn't need the NavMesh, unless you're using path finding.

You could design volumes for areas to ignore navmesh, and give character direct directional input when inside.

Be Sure to set your nav mesh to be able to updated dynamically at runtime:

  • Project Settings

    • Engine - Navigation Mesh

      • Runtime

        • Runtime Generation = Dynamic

more ▼

answered Mar 27 '19 at 06:25 PM

avatar image

2.2k 39 17 52

avatar image OniricMaster Mar 27 '19 at 06:56 PM

Thank you, that solved the issue. Im also having an issue with the character having trouble jumping onto platforms sometimes and im not exactly sure whats causing it. https://www.youtube.com/watch?v=SLnMA_NO5Ts&feature=youtu.be heres a video I posted in order to show what happens. Basically its like theres an invisible collision that blocks the player, I think the issue is with how the simple move to location works but im not exactly sure. Any ideas? Also this is the main character, its a top/down game so it uses the same movement system as found in the top/down template.

avatar image BenVlodgi Mar 28 '19 at 01:39 PM

SimpleMoveToLocation isn't designed to utilize jumping.

I think the problem you're seeing, is the timing of when you hit jump. The jump continues in the direction the character was heading before they jumped. They can't jump forward if they weren't already moving forward.

You should probably avoid using SimpleMoveToLocation for close set waypoints, and instead use character AddMovementInput.

Also when you press jump, you might want to set the character direction facing towards the waypoint instead of current direction from the MoveTo navigation.

avatar image OniricMaster Mar 28 '19 at 07:12 PM

Thanks a lot for your help i've been stuck with this issue for a few days now. Ive implemented what you suggested. Now it checks the distance between the player and the mouse position, if its more than 800 it will use the SimpleMoveToLocation and if its is less then is uses AddMovementInput. Ive also created a function within the player controller to modify the players direction when he jumps. It seems to be working quite a lot better now although there are still a few issues. 1 - The AddMovementInput only works if I hold the Left Mouse Button, if i simply click once he will move but for one frame only it seems. 2 - Also sometimes when I suddenly change the direction of the character he will start moving backwards (so in the direction he was previously moving) , this only happens sometimes.

In any case Thank You soooo much my dude. You are The Man!

avatar image OniricMaster Mar 28 '19 at 07:28 PM

I found the reason why the character was slowing down. It was simply that was clicking far away so it was registering the MoveToLocation when I then tried to move in another direction it was still trying to go to the previous MoveToLocation. Thats fixed now, the only issue is getting the player to move to the position when I click and not only having to hold the key.

avatar image OniricMaster Mar 28 '19 at 07:41 PM

I figured I should post the screenshots, someone else might be having the same problem. ![alt text][1]

![alt text][2]

![alt text][3]

1 - The event graph determines whether to move or to jump 2- Jump Function determines the direction of the jump when player clicks (The actual jump is done through the player character, using a Jump Node, (Launch Character node can also work.)) 3 - MoveToLocation simply moves the players to the location of the mouse click. If the distance is more than MinClickDistance then moves using Simple Move To Location node if not then uses AddMovementInput. [1]: /storage/temp/272685-controler-even-graph.png [2]: /storage/temp/272686-jumpfunction.png [3]: /storage/temp/272687-movetolocation.png

avatar image BenVlodgi Mar 30 '19 at 11:31 AM

Glad to hear those things helped!

To get the player to continue moving forward, you'll need to apply the movement input on tick for a duration. You can use Function Timers or Delay/RetriggerableDelay to get the timing you need.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question