Moving wall / cube pushes player in steps and not smoothly, how to fix? [SOLVED]

I will surely get to C++ eventually, don’t know if I am ready for that yet lol.

I still think something could be or should be able to be done with that kind of approach, physics based or otherwise. Get the location and velocity of the wall, and if the player is overlapping (capsule or mesh) then do something, In what you just described it would be to turn physics on and apply a force when overlapped then turn off when not. Going back to earlier in this thread… if I apply this code below to the third person character.

Then the player moves automatically at the same speed as the wall. Desktop 20211118 - 21490202 on Vimeo

You will notice on that video that the stepping effect does not happen, but then the player is being pushed along, “offset”? all the time anyway.

Imagine then if that effect happened “just” when TPC overlapped the wall. As pointed out earlier in this thread, the problem is not when player jumps into the moving wall, as collision will cause the capsule to be blocked, and blocked smoothly, the problem then is when player Is Landed and is pushed by the wall, and the inherit shape of the capsule component causes this stepping effect.

Maybe you are over-thingking it too much.

If the wall makes contact (hit event)
Toggle the physics simulation.

The push and movement should just happen without anything special since you are now setting the capsule component to be able to simulate/react to the environment (That’s the point of toggle simulate physics on/off).

Then you just need some sort of system that brings you back to not simulating.

For sure, it should be fairly simple I would think.

Looking into the hit event approach now.

Right, thanks again.

1 Like

And finally…I got it.

The key this time seemed to be a box collision around the player sized accordingly.

So then in the camera actor blueprint that has the moving cube attached to the camera, I check for collision between the moving cube and that box I just added to the TPC, and if so I add an offset matching the moving cube’s offset / speed.

For some reason, it has to be that box to check for in the IsOverlapping or it does not work, I tryed with the CC and it was the same og problem in the OP.

https://vimeo.com/manage/videos/655563550

This isn’t actually physics based at all.

Also, you probably don’t need the box. You can detect collisions purely from the pushing box, and implement an interface on the character Or just cause the box to move the character after it detects its a character.

No real need to cast or much else.

If collision > move actor position.

The actor position isn’t walled behind a cast.