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.
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.
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.
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.
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:
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.
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.
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)