Hello UE4 community,
I’m hoping to get some help on a (probably simple) physics issue. I’ve been (self paced) learning UE4 for a while now, but haven’t really used physics before.
Scenario: Scattered physics objects in a level that should be able to be “pushed” or “nudged” by the player capsule or projectiles.
Problem: Sometimes when the player walks into the physics objects scattered around the level, the object or player “flies away” at extreme force. This also happens occasionally when two physics objects collide.
Actors: FPS player/capsule, small cubes launches as projectiles that scatter around the level, some interactive props (a cart, some melons & pumpkins).
I’ve attached screenshots of the physics and collision settings. Can anyone offer any help?
1 Like
Hello LoneScrapBot,
Just spitballin’ here - but I noticed that your Character capsule has a mass of 238kg while your movable prop has a mass of 495kg. Have you tried adjusting the mass of these entities?
Hi , thanks for your reply. I did have a play around with mass, but it didn’t seem to make a difference to that behavior. The smaller props (also spawned as projectiles) have a mass of 2Kg. Both those and the player can send the 495Kg prop flying like it was a tiny rubber ball.
Could it be that objects stacked / pile on top of each other are interfering with / multiplying force responses? As far as I can see any time it happens there is a pile of objects stacked on top of each other.
1 Like
I have reduced the push force factor from 750k down to 500. Things seem a lot more normal now. Not sure if that setting was default in the FPS template or if I had accidentally overwritten it.
In my case I had a projectile and of course its target, when it hits its target the target go crazy(rotation wobbling), besides the huge bounce that happen. I just set up overlap instead of collision, enabled CCD and Trace complex on move. Now it is working as expected, at least for my game. Hope it helps.
This is quite old now, but recently I was playing with a different project and believe that I now understand what was causing my trouble back at this time.
On the physics object (e.g. a ball Blueprint actor) the following worked well:
- Enable CCD
- increase BP_Ball > Physics > Position Solver Iteration Count
- increase BP_Ball > Physics > Velocity Solver Iteration Count
The settings I was using satisfactorily in my test project were: Position Solver Iteration Count: 10 and Velocity Solver Iteration Count: 2
It should be noted that computer spec will play a significant factor in what settings work well. Lower spec machines may require higher settings to avoid skipping a physics interaction test at a crucial moment. As far as I understand it, these settings control how regularly the position and speed of the object are tested and the physics interaction calculated. So the frequency is too low, your ball may pass through an object rather that bounce of it or something like that.
thecodermarcelo 's comment above is on the money although I haven’t played with trace complex yet. I will do so.
I hope this helps someone else!
I had a similar case, but my “character” was actually a vehicle (truck), so the capsule was not fitting it very well and often when the truck would drive over something, it would get catapulted into the sky.
In the end what helped most was:
- reducing the push force factor (from 50k to 5k already helped a lot)
- setting repulsion force to 0
- finally, setting collision preset on the capsule to “query only (no physics collision)” and creating a new “Box Collision” element, with “Pawn” collision preset and sizing it to fit the truck nicely.
The topic was 5 years old - the engine doesn’t use the same Physics as it did then.
Vehicles - now probably Chaos Vehicles - have their own specific definitions and PHAT asset definitions that deal with physics.
1 Like
Thanks @MostHost_LA , not only I’m a noob but also didn’t realize it’s such an old thread. My intention was to help someone with similar problem, but looks I might have caused even more confusion in the process
I will check the dedicated vehicle physics you mentioned, that sounds promising for my project!
1 Like