How to stop characters being pushed around by rigid bodies?

Hi,

We are having trouble with our characters being pushed around by moving rigid bodies and other characters in ragdoll state. If the moving rigid body is big enough it will push the character aside, which is only half bad, but if it is smaller than the character’s Max Step Height, then it will “slide under” the character and abduct it on a journey, despite being set to CanStepUpOn=false. I am unable to find any settings on character or rigid body actors that can stop this behaviour. Would you have any ideas how to do that?

Kind regards,

Marcin Dudkowski

Try this on the ragdolls / physics objects (copied from TP_FirstPersonProjectile):

// Players can't walk on it
CollisionComp->SetWalkableSlopeOverride(FWalkableSlopeOverride(WalkableSlope_Unwalkable, 0.f));
CollisionComp->CanCharacterStepUpOn = ECB_No;

CanCharacterStepUpOn only solves half the issue, it prevents them from trying to step up on it if bumping in to it. The other line makes it completely unusable as a walkable base (In UCharacterMovementComponent::IsWalkable you’ll see a check for the slope override).

1 Like

Hi,

We think this post contains useful information which we would like to share with our public UE4 community. With your approval, we would like to make a copy of this post on the public AnswerHub which includes the discussion but strips out your username and company name. Please let us know if you are okay with this.

Thanks!

Hi Ben. Sure thing. Go for it.

Hi Zak,

Thank you for your reply. I found the property you mentioned. Setting the Override to True and Slope to Unwalkable reduced the effect ever so slightly, but did not stop it from happening. Could there be something else I can try?

Kind regards,

Marcin

Hi Zak, I found it. On top of all of this, it was also the Movement Component which was making the characters “jump out of the way” when the capsule component was being obstructed by the rigid body. Setting the Capsule to EnableCollision from NoPhysicsCollision (default for “Pawn” preset) in additional to all of the above finally makes the character immovable by the rigid body.

1 Like