Smoothly push character with moving object

Hey there.

I’m working on a few platformer elements for my game and one of the immediate problems I ran into was that of smooth character movement when being pushed (Moving walls pushing player off a walkway, for example).

I have a video here to help with visualization: How to push character smoothly? - YouTube

Attempted this in a completely different project and it happened there too. So I assume you can replicate this with a standard third person project and a moving box of any kind.

Some things I’ve tried so far involve CCD (Constant Collision Detection) on both the character (capsule collision, mesh, etc) and on the moving box itself. It doesn’t seem to help. I also tried to figure out some sort of blueprint to get either an impulse or world offset going in the direction of the cube, but I couldn’t quite figure out the maths behind it.

Thanks, and let me know if you need any further information.

Are you trying to have something like this: Smoothly Push Character With Moving Object - YouTube

It’s not perfect, I threw it together really quickly just to make sure I understood what you are after.

Exactly. How’d you achieve that?

Basically I’m making a training course for a platformer game and part of the course has walls that push the player down to the level below.

Using an Add World Offset to the character at the same time as using a timeline to move the cube. Like this:

Its not perfect and could use some polishing for sure, maybe use delta seconds with the offset to smooth it out some more…either way its one of doing it that isn’t overly complicated.

Thanks man. I was on the right track it looks like, but I feel like that should be the standard behavior when the player gets hit by something.

I would still like to hear anyone else’s input on it if they have any ideas, just so I can know more than one approach if there are any.

Hey, one more question. Do you think there’s a way to get the direction an object is traveling in and then just apply offset to the character using that direction? That way it could work for all 4 sides.

That’s what the above is already doing by using the forward vector of the BP