Download

Move Actor Smoothly With Object Collision

I’m having a really difficult time getting an object moved with Set Actor Location to smoothly push my character while the character is on the ground standing still. The character begins to overlap then shoots out of the mesh every ~20 or so frames instead of being pushed away every tick like it should. That being said, it is working perfectly while the character is either moving or in the air. I really hoped enabling “CCD” (continuous collision detection) on the capsule and mesh would work but it didn’t do anything.

I created a new third person project (v4.211) to see if it would happen to the default mannequin and it does.

I’m so sorry for this super short low fps video but hopefully it demonstrates what is going on (turn on video loop if you want to blink and still see something):

I am not controlling the character because, as you can see, the camera goes absolutely nuts as the character is inside the mesh then shoots out.

Here is an example of walking INTO the moving block. It works perfectly.

Again, my sincere apologies for the awful video.

The block blueprint is very simple (the static mesh is root and only component):


I obviously can’t enable sweep or else the character will block the mesh from moving along its path.

I understand I could do some hacky workaround by putting triggers on either side of the object and adding an offset to the character but that just seems wrong. I’m making a side scroller with lots of different platform/block meshes and have already programmed wall sliding. There has to be some way built in that allows for this functionality. Seeing as how it works perfectly while the character is moving or falling, I can’t understand why it won’t work while the character is idle on the ground.

Surely someone has to have experienced this before. It seems so simple and it’s frustrating that I’ve wasted a whole day fiddling with this. All the “solutions” I’ve seen use overlap box components that add an offset to the character location.

Thank you so much in advance!

Tidbit of info, the character class actually attaches to the floor (detaches on jump/fall and switches on gravity). So I believe what’s happening is once the box overlaps the character completely, the character thinks it’s now falling and is forced to detach. So you can jump on top of a vehicle running at mach speeds and you’ll just glue your feet to it. It’s wonky.

I don’t really know the best way around the issue. Maybe checking “always create physics state” in the capsule collision will just fix it and push you out.

Hey @NotSoAccurateNo1 thanks so much for the response! Unfortunately that didn’t work as I hoped it to. I appreciate the tidbit because it makes more sense why this is happening but also baffles how there isn’t a simple workaround (I still have my fingers crossed there is one).

I’ve never had so much trouble with something so trivial I would really appreciate any other suggestions / input.

Well I stumbled upon a few threads that have responses from STAFF (from 2014 and 2015) that say that the functionality is unsupported. I was really hoping that in 5 years it would have been implemented. It seems super bizarre that it’s not to be honest.

Anyways… I created a blueprint that gives the effect I want. It’s pretty simple because I’m using it in a side scroller. I’m probably going to turn it into a C++ component so I can add it to the actors where the character could be idle.

Here is my version for anyone that’s interested. It’s far from perfect but it gets the job done:
Imgur
I couldn’t upload to the forum because the image file size is crazy small.

I am still very interested if anyone has a workaround without any bp/code. Please let me know if this has been fixed.

You can add input vector everyframe and set the value to 0.001*sin(time) to make it extremely small and periodically stop.
Hope this will help.