I have an armored vehicle whose mass is set to 45,000Kg. A player character whose mass is less than 100Kg can bump into it and send it flying. That’s not exactly realistic. Is there a way to fix this?
Try setting the tanks collision to just overlap the Pawn channel, I think that will make the tank not move when hit by a pawn, but still give you the option to damage the pawn in the overlap event.
Setting to overlap doesn’t really fix the problem. That simply allows the player to pass through the vehicle. It also makes it impossible for a player to stand on the vehicle. This is actually a significant problem since it appears that UE4 is unable to support a mix of pedestrians and vehicles without major physics issues.
Well it works with the cubes in the first person shooter example. So there might be something wrong with your settings. Could it be that you typed in “45,000” and it changed it to be actually just “45”? I noticed that that’s what’s happening for me.
Either way it works just fine for the example, so you might compare your assets to it and see what you might’ve missed.
I did a test with a cube. I placed it in a level, set its mass to 45000Kg, and had the player jump on it and try to push it. It bounced around like a beach ball. The player had no trouble moving it by simply jumping on it or running into it.
Does this happen for you aswell if you create a new Project with the First Person template?
In that one the objects behave the way you want so you might find what makes them different from your box/vehicle.
If that doesn’t help them I’m out, sorry!
None of the engines supports this except if your characters are completely physics driven.
Kinematic bodies such as characters are not driven by physics but animations or kinematic movement - manually calculation position of the character in the code. What happens is your character can’t be effected by physics and when it collided with something, PhysX will try to push colliding objects apart, but as your character can’t be pushed back only the other object I’ll be pushed.
What is normally done to solve this is a sweep test of character capsule along his movement path, to check if it will collide with something if he continues to move in his direction. I don’t remember having such issue with FPS template. Which template are you using for your character?
not using the canned template for the character. But the c++ code which manages the character is based on the FPS example.
Was passing by and wondered if this issue was related to the horrible-car-physics series of problems?
Some devs argue that PhysX is fundamentally broken in UE4… (UDK never behaved this way etc)
All engines BoredEngineer… ???
In UDK Characters & Vehicles (both kinematic right?) are affected by physics actors (Kactors etc)…
Example: Falling towers of KActor oil-barrels can & do push players about & knock over vehicles etc.
But in Machinery Modelling Toolkit you must do lots of experimenting. Is UE4 a whole other beast?
This seems like a major omission for UE4, considering that mixing vehicles with pedestrians is hardly new. Cripes, even UT had both and that’s ancient now.
UDK character code is not the same as UE4 third person template. You are comparing specific implementation of character for UT to a bare bone code of the template.
Not everyone is making a game with pedestrians and car. For some devs it will be even detrimental by conflicting with their game rules.
Any specific reason you can’t add functionality that you want?
If I remember correctly character did have some separate force value that it applies when it collides with another physics object. I fiddled around in some football game concept and the ball was sent flying everytime it collided with player. Turning the force down solved the problem for me. I’m sorry but I have no editor available at the moment but check out the MovementComponent configurations. If I remember correctly it was controlled from there.
Edit: UCharacterMovementComponent | Unreal Engine Documentation I think it was the InitialPushForceFactor.
I tried setting the interaction force on the movement component along with some of the other physics settings and it had no effect.
FPS template works in a way you want, check it’s movement code.
That’s not entirely true. It’s only works if you run it in Stand Alone mode. If you run the demo with the dedicated server box checked (multiplayer), bad things happen.
If you see obvious bugs then report them. Anyway, the point is to look into how physics interaction is done in template and not what else is missing there for your specific case.
The whole physics simulation system seems to be inconsistent,
here are a few of the things I have come across…
Try adding a child actor to an actor, its physics and collisions are either none existent or totally haywire.
eg a child actor with collision could be pushed by a pawn in one direction but the other direction locked solid… …Yet the actor could move freely through the pawn in both directions and not collide .
Add two components to an actor without physics enabled.
Give each a custom set of collision properties eg hook and chain… select either of them and the correct custom/hook–chain collision properties show
Select both at the same time and you will see that as a pair the so called custom properties are probably listed as world dynamic or world static … and changing these properties as a pair does affect the relative collisions.
Go back to selecting just a single item and the correct ??? collisions are shown.
An actor with a physics material will behave differently to the same actor with a “material” that has a physical material component ( same physical material)
Constraints on a child actor do not constrain (or very weak)
Setting custom collisions and giving it a custom group eg hook or chain ( set up in project settings ) does not give the same result as say …physic body with identical settings
(corresponding collisions from the other way were matched to whichever group was allocated )
Why does giving a component mass (physics disabled) alter its behaviour ?
If physics would work in a consistent and relative manner there would be no limit to the mechanical simulations possible
So far I have been able to ( by trial and error) overcome most limitations to produce a purely physics based rail system but methods are extremely inconsistent.
This thread was a savior !! … was frustrated with a setup where a car runs down my character which has to trigger ragdoll if detects more than threshold force … forgot to turn off block for character capsule which resulted in character ragdoll but the car was knocked around too … turned the capsule collision to ignore and my player is flying around without messing with car PhysX … thank god … almost had to skip major gameplay element of my 1st game !!
I know this is an old thread but does anyone know how to actually get dynamic objects not to be bounced away by the player? Or is there any blueprint/c++ code that will mirror how the character movement component but with physics?
I came up with a workaround for this issue, I also have a vehicle and a character that can drive it.
What I did was have a invisible copied mesh thats exactly the same as the vehicle mesh and have that to be kinematic, then in the tick update its location and rotation with the real mesh and have the character only collide with that copied mesh instead of the physics mesh.