x

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"

Ball won't bounce off walls correctly. (Sticks instead)

I'm trying to get a simple physics game working that uses a ball. The ball needs to bounce off walls realistically. However, when the ball approaches any wall at a relatively small angle, it just sticks to the wall instead of bouncing off.

Is there any possible way around this? When going head on at the wall, the ball will bounce. It will also bounce all the way up until around 20 degrees or so, depending on the velocity.

Edit: I wanted to clarify this question a bit more. Here is a quick drawing of the problem:

http://imgur.com/a/cMObE

alt text

I need the case on the right to not happen anymore. If I had to guess, I'd say that the collision logic has a bug in it where it tells objects to not have any velocity other than parallel to the normal if it's going slow enough.

I've already tried setting up physics materials, using projectile motion, and tons of other stuff. I'm considering just writing my own physics implementation of this, but I'd really rather not since I feel like this should be a part of such a big engine.

Product Version: UE 4.13
Tags:
ue4.png (75.3 kB)
more ▼

asked Oct 26 '16 at 11:03 AM in Using UE4

avatar image

Barbacamanitu
21 5 7 10

avatar image ImZeperoni Mar 11 '17 at 03:34 AM

Hey did you ever fix this?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

6 answers: sort voted first

Hi, I think I have the answer to your problem: You must enable Sweep for your movement. I'm not sure if you used blueprints to do this, but here is how you would have to set it up.alt text If you use the unreal physics you would have to look it up.

Please let me know if this could help you.

bounceball.png (336.3 kB)
more ▼

answered Oct 28 '16 at 02:40 AM

avatar image

Hololol1
6 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Have you played around with physics materials? A bouncy one (Restitution = 1, friction = 0) should result in something that doesn't ever stick to a wall.

more ▼

answered Oct 26 '16 at 02:09 PM

avatar image

Chris.Jack
1 2 3

avatar image Barbacamanitu Oct 27 '16 at 02:32 AM

Trust me, I've tried every conceivable combination of physics materials ranging from 0 to 99999999.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I'm not quite sure how you are using the ball but the physics material should work. A method of achieving this is to use a projectile movement and set bouncing on. alt text

bounce.png (575.5 kB)
more ▼

answered Oct 28 '16 at 04:04 AM

avatar image

Nken418
353 11 3 14

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I could fix this problem by enabling sweep on your SetActorLocation Node. If you are using the unreal physics settings I would recomend to use velocity instead of SetActorLocation, in this case you can also add a Projectile Movement component to your actor to gain more control over the bouncing behavior.

more ▼

answered Mar 11 '17 at 10:39 AM

avatar image

Hololol1
6 1 2

avatar image ImZeperoni Mar 11 '17 at 01:19 PM

What do you mean SetActorLocation? I use the Add Force, why would you make a ball roll with SetActorLocation? And when I add projectile movement component it doesn't affect the ball much at all

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Here's what I used for the case of a ball mesh bouncing being moved by "Add Force" against a wall in zero gravity (ie: gravity turned off on the mesh):

On Component Hit event on the ball itself:

alt text

Where impulse or force would work. The Float multiplier from the impact normal would need to be adjusted depending on your use case - ideally it could be some ratio or factor of the current balls veloctiy.

Note this is only required for zero gravity casesI think ;)

more ▼

answered Oct 27 '18 at 11:36 AM

avatar image

aussieburger
1.5k 41 174 74

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

[Keywords: unreal engine, bounce, problem, stick, velocity, angle]

If you are using v4.21 and experience what is described above, check this:

There is a threshold value, probably for preventing bouncing from never ending. (referred to as "simulation stability")

Goto:
Project Settings -> Engine -> Physics -> Simulation

There you will find "Bounce Threshold Velocity".
Read the field's tooltip and think about how low you can set it. ;)

more ▼

answered Mar 29 '19 at 01:46 AM

avatar image

btvr_swe
1 1

(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