DO NOT use Event Tick, use Event ActorBeginOverlap

This is a small workaround, so the amount of lost computational cycles is negligible and should be fine

I feel like you’re missing something in your explanation as I did exactly this, but I’m not getting any smooth movement

It doesn’t even seem to generate overlap events in response, I have both the pushing cubes and the player set up to generate overlap events, so I’m not entirely sure what’s going on here

This doesn’t fix the smooth movement, it makes sure the character gets pushed by the cube. I haven’t figured out the problem with smooth movement but I do see that it’s only smooth if the character is not moving. If the character is moving, it’ll clash with the cube.

Just make sure you are getting pushed by the cube, if not. Check your code or post it here for review.

Hi Adam - This does not solve the original problem and lands you right back with the same issue (the character flashes when hit by the cube).

Yes, I did mention that in the original post at the bottom. It wasn’t designed to either. It will fix the all the animation issues that occur when it’s assigned to event tick. Tick runs every frame and the character is not being pushed every frame so that’s why it’s a bad choice.

I like the solution proposed by @DanM in the “The move-left-then-right workaround” thread.

NB: The “sweep” feature only applies to the root component, so remember to replace the default root with the cube, or with a collision mesh

NB2: I think his code might be a bit more complicated than necessary. The distance/direction/delta seems overcomplicated. A simple hit.GetActor()->AddActorWorldOffset(hit.TraceEnd - hit.TraceStart); should be enough since the platform is being moved in the same direction as its velocity.

Thank you I was having this problem and it fixed my character moving properly again thought i did something wrong but i apparently didnt. Now the problem i am having is it is very glitchy when the character impacts with the object i dont think it is my laptop but it could be I have a maingear nvidia 3080 laptop with a ryzen 9

Hi, just so you know, the BeginOverlap event won’t ever emit, because the collision is set to block and not overlap. You can test it by adding a print String node at the end.

Actually, there’s a property called “Generate Overlap Events” and as long as that’s enabled, Overlap events will always trigger regardless of collision.

I’ve checked that box on the player character (it’s not present on the platforms) and it’s not emmiting the events when the collision is in block mode.

Oh no, you must set it on the Static Mesh within the BP_PushingCube.

I have it checked, the event is still not triggering. Using UE 5.03 btw.

[edit:]
Here’s the setup that worked for me:

I’ve also added a collision box to my BP_PushingCube that is minimally larger than the original cube, and has collision set to overlap on actor and ignore on everything else.

3 Likes

@Wojte, just tried your way, and outside of it taking a second to figure out how to make the custom event boolean, it works like a charm. Only issue I’m able to find is that there is a small amount of drift to the left (while facing block) while beign pushed. This seems to be relative to push direction, so it’s always left while being pushed backwards. Any idea what might be causing this?

Other than that, want to reiterate, works splendidly and doesn’t break animations.

[EDIT] I just realized my cube was being moved on the X axis as well as the Y, without being rotated accordingly. So it was actually the cube moving left, not my character :stuck_out_tongue:. Your solution has no issues.

I used @Wojtek screenshot as the basis but was able to use the video solution with a minor include for Get Actor Rotation. This fixed the character not rotating when using the video’s solution. I’m using Unreal Engine 5.1.

14 Likes

Just tried your method. Works perfectly.

If this was stack overflow this should be the correct answer for quickly fixing the bug presented by the video solution.

Thanks Mike

Works for me with UE 5.03.
Thanks for sharing Mike

Doesn’t the video already mention this on 11:00?

2 Likes

This worked like a charm.

I wanted to avoid the Tick event as much as possible, so this solution was great! Thanks!

Privacy & Terms