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"

Rolling AI

Hello, I'm currently working from a rolling template and I managed to get an AI sphere character to follow the player through the nav volume with AIMoveTo and I kinda faked the rolling part. How can I make a Sphere that would behave with simulated physics like the Rolling ball the player but in a way to follow the player through the navmesh ? Any help would be greatly appreciated.

Product Version: UE 4.16
more ▼

asked Jul 25 '17 at 06:08 PM in Blueprint Scripting

avatar image

1 1 1

avatar image milkstache Jul 26 '17 at 09:27 PM

Alright so I figured out the main part. I donćt know how clean this is but it works for me. I worked off of a pawn blueprint and mushed some turret and roller controls. The result is a ball with simulated physics that drives around the map always going towards the player. Don't know if it can pathfind, probably not but that's ok I can work around this in this project. The problem now is that the mesh is static while it moves since I have to adjust the direction of the ball towards the moving player pawn. I think I could fix this with a panner material that gets the player speed. One issue is that the UV of a sphere makes the material shrink if it pans on the right axis like it should when rolling. I could pan from left to right to avoid shrinking but then it pans on the wrong axis so I should either rotate the pawn, which it won't let me for some reason, or adjust the axis around which it aplies torque and faces the player. I didn't go into any of this so If anyone could point me to how to do any of these I would appreciate it. I'll leave a screenshot of the behavior for anyone possibly looking for this in the future. alt text

capture.png (210.9 kB)
avatar image milkstache Jul 27 '17 at 08:31 AM

Update, this is the best I can do for now. The AI Pawn Ball rolls like it should like the rolling ball example player, with physics and all that good stuff and goes wherever the player is. The only nick is that it will go directly to the player in a straights line. If anyone would care to help me add navigating through the nav volume to this I would be thrilled. Hope someone finds this useful. Blueprint in attachment, my roll torque is 500k.alt text

rolling ai.png (159.6 kB)
(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Only the middle one seems to fit the bill. I want it to simulate physics. I could do without the pathfinding but it would be preferred. I was trying to go about it by adding constant torque to the ball (still need to figure out how to limit it so it doesnt accelerate out of control) and somehow finding a vector to rotate the Yaw towards the player like a turret but had no luck so far.

more ▼

answered Jul 26 '17 at 04:02 AM

avatar image

1 1 1

(comments are locked)
10|2000 characters needed characters left

There are a few ways you could achieve this.

  • You could turn the ball into a skeletal mesh & create rolling with animations then using a blend space to control the speed of the rolling.

  • Work out a formula to apply negative impulses to push the ball along the calculated AI path (pretty complex)

  • Fake it through SetComponentRotation & Actor Speed / Velocity . E.g if speed > 0, on tick SetComponentRotation to it's current rotation + some. You could also use a lerp to give this smoothing.

Hope this helps!

more ▼

answered Jul 26 '17 at 02:44 AM

avatar image

128 7 12 21

(comments are locked)
10|2000 characters needed characters left
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