GASP and Traversing Moving Obstacles

Hello Forums.

Does anyone know how to properly traverse a moving object in GASP?

I have tried attach actor to actor and the detach from actor (will all types of settings) but I keep running into a problem. The character glitches out a little and if the object is moving towards you, then you end up going through it a bit before traversing, which makes you appear to be traversing in mid air or inside the object. I have uploaded a short video so you can see what I mean.

Any ideas?

I have since tried adding an actor world offset to the player when overlapping a box on either side, it helps about 50% of the time, but character still slips into the obstacle a lot.

Is this running is a single player or multiplayer environment?

1 Like

Single Player

I have sort of made some progress. I Have added sockets to the mesh. Then I use get all sockets and find the closest one, set actor location to that socket and attach actor to the socket until the traversal is complete.

Its kind of bad execution wise and doesn’t quite feel right. Even if I Add a quick timeline to lerp the location, I still get some clipping issues and takes a lot of adjusting the sockets so the animation line up correctly.

Can you get the actor velocity in the frame that the platform is changing direction? My gut feeling is that should be at rest on the box but for some reason is different and that confuses the movement controller or the animation system.

Also try to stay completely still on top of the platform to see ho the character behaves.

Not going to lie, I’m having some real difficulty figuring this one out.

How would I get the actor velocity and adjust my character to match the velocity until the traversal action is finished?

I mean it sort of almost does by attaching actor to actor OR actor to component. Its just off on the connection.

In my opinion your initial approach is correct. Attaching is the way to go.

I am not sure how and when you are attaching the character. If attaching to sockets fixes the problem it is obvious that in your first iteration you use incorrect position. There is also a slim chance that you take the correct position but then in the same frame the platform moves. It’s worth trying to tinker around with the tick order for the platform. (before/after/during physics)

If you want to mach the motion perfectly you should probably attach the character from the moment the player hits the button. Of course you should check if they would succeed or not based on distance speed and height of the platform but being attached you can continuously adjust the character local position until they land exactly where you want them.

I’m at a loss here. I have tried just about everything I can think of and even tried a lot of similar solutions found online. I Believe you are correct that when attaching the actor, the block has moved too far since attachment. Even using set location or using a timeline does not get it anywhere close. I have tried changing all tick settings, but no success.

There’s no delay in the attachment, it is immediate. I can’t believe no one else out there has had this problem and solved it. Its a real head scratcher. It should just simply work, i don’t understand why is doesn’t.

Can you show us the BP where you attach the two actors?

I have made some progress, I can get the player to climb onto the moving actor at the front and back, but the sides are still a bit dodgy. I will post a video in a bit to show you. Here’s the blueprints:

Moving Check posted by anonymous | blueprintUE | PasteBin For Unreal Engine

Still having some issues if I try to get on the actor when it changes direction.

Edit: Figured out this is because of the root motion in the animations. If I change the root motion mode then the player just does the animation in place, which is not the desired result. Once again I will have to keep researching.

I have done some more work on this and its getting closer. Still has a few small issues.

1.) Sometimes the Z height of the character goes above what it should.

2.) After climbing onto the moving actor, character will bump up or down a little bit, probably because its not getting the right height

3.) Every now and then it won’t move to the correct location and climb onto nothing, while still moving (attached) to the other actor.

This:

Check If Traversal Is Moving posted by anonymous | blueprintUE | PasteBin For Unreal Engine

Goes into This:

Which then goes into this:

Moving Traversal Graph posted by anonymous | blueprintUE | PasteBin For Unreal Engine

You are going further than I can follow :slight_smile:

I haven’t tried attaching moving actors.

I still have the nagging feeling your problems might stem from the order of execution of the movements.

Can you show me the blueprint that attaches the two actors together?

Also how do you actually move the capsule on top of the box? Is it moved by a root motion animation or do you move it with BPs?

Root Motion drives the animation to climb on top, I only move the character to the x and y of the moving objects socket so the animation lines up.

Just made a brand new G.A.S.P project to test this. This is a bug in the original project too.

If you are tracing by holding down the jump button, climb on the traversable, then drop off the traversable you just climbed, then climb onto it again from the floor while still holding space, if will cause this bug where you climb on a lot higher than you are supposed to.

I am sorry but the resolution does not allow me to read you BPs.

Can you try disabling the root motion and checking how it behaves. I know it would look bad but I’m trying to isolate the problem.

1.) Sometimes the Z height of the character goes above what it should.

Sounds like the height is not resting after the climb and on the second climb is added again for “double climb” in the air.

2.) After climbing onto the moving actor, character will bump up or down a little bit, probably because its not getting the right height

Sounds reasonable. How is the height calculated?

3.) Every now and then it won’t move to the correct location and climb onto nothing, while still moving (attached) to the other actor.

From the video I see the char starting to climb properly but on the pull-up, being yanked back to their original position. Something breaks and I think the root motion is fighting for control or the attachment fails but I might be wrong.

These are my blueprints uploaded to imgur for better quality.

The height is calculated by the “Try Traversal Action” in the GASP standard project.

Moving Traversable Climber posted by anonymous | blueprintUE | PasteBin For Unreal Engine

Re-organised all the code into one graph. (Except for the detection of a moving traversable actor, but that’s irrelevant to this code.)

I have made some great progress with this today. It now seems to work perfectly every time, except for the bug where it climbs slightly higher than it should some times (Bug is also present in the un-edited version of G.A.S.P. I should probably send them a bug report)

Video to follow soon.

Still randomly getting the issue where it climbs too high.