Apex clothing lag while driving vehicle

I use Apex Clothing for my female character’s hair. I’m noticing when moving on a vehicle, the hair lags behind the pawn it’s attached to.

Example video: Apex Clothing Lag - YouTube

I’ve read the Epic docs on this and they do mention something about it. They mention that setting bForceUpdateAttachmentsInTick=true for that skeletal mesh component should fix this.

However this doesn’t seem to work for me. I also tried setting this on the vehicle’s mesh component. I’ve also ensured that my pawn has TickGroup=TG_PreAsyncWork.

Anyone have any ideas how I can resolve this? Thanks

I have the same problem with the sail ships. Only if the ship is in the persistent level works properly.
Seems to be a problem with the tick order.

Any ideas how to affect the tick order for attached components?

This issue only appears to happens when attached to vehicles.

I have other Apex clothing assets that are attached to moving actors (like on weapons held by the player), and they will lag behind but are fixed by setting bForceUpdateAttachmentsInTick=true. However this seems to do nothing when attached to a vehicle.

Does this problem also happen in the editor? Digging around in the C++, looking for bForceUpdateAttachmentsInTick, I found some interesting stuff in USkeletalMeshComponent::UpdateTransform(). It needs to call UpdateChildComponents(), which it does if it’s running in the editor. UpdateChildComponents() does not get called while running the game itself because according to a comment, UActorComponent::UpdateComponent() should call UpdateChildComponents() when UpdateTransform() returns. That would be one thing to check.

Another is this section…

			for(INT i=0; i<Owner->Attached.Num(); i++)
				AActor* Other = Owner->Attached(i);
									Other->ForceUpdateComponents(FALSE, TRUE);

So if you can’t or don’t want to muck around in the C++ yourself, you could probably still find a way to force the game to call UpdateChildComponents() or ForceUpdateComponents() while riding a vehicle. I would try it during TickSpecial.

I am still using UDK for GOTA new update soon… but hey emmhhh, isn’t this technology maybe too old? ( clothing ) … ? no idea…

Thanks for the input @Nathaniel3W.

I’ve tested in the editor, and the same lag is present.

I also tested calling MyPawn.HairSkelMesh.ForceUpdate() in the vehicle TickSpecial() and Vehicle TickSpecial(), and the lag persists.

If i don’t attach the driver (which usually gets set using: driverPawn.SetBase(self, , Mesh, Seats[seatIndex].SeatBone)), and simply SetLocation() on the driver each TickSpecial() on the vehicle, then the hair is in sync with the player pawn (even if it’s a bit twitchy).

I’m reaching the point of starting to think of some wild hacks/solutions now to get around this issue :wink: The issue only happens with the hair (Apex Clothing), but using a static model (no Apex simulation) looks pretty awful when you’re used to seeing the hair move around.

Also worth nothing; that if I switch my pawn to rigid body physics and toss them at high speed, the hair stays in sync with the pawn. So the problem is purely to do with the vehicle ticking it’s attached components.

Well, if you’re thinking up wild solutions, here’s my suggestion:

See if you can give the vehicle hair. Add an extra bone and a socket. Attach the hair to the socket. If you drive the vehicle around, does the hair move correctly?

If the vehicle’s hair moves correctly, then hide the player’s hair when the player gets on the vehicle. And do whatever you have to do to set the vehicle’s hair socket to the player’s head location while driving the vehicle around.

Haha, well that was one of the first things I tried. Unfortunately any skel mesh component (with apex clothing) lags the same way, even when directly attached to the vehicle.

The next desperate hack i’m considering is predicting a translation offset based on the velocity of the vehicle to account for the clothing lag… Very gross indeed :grimacing:

Did you ever fix this? Maybe you can try setting bAllowOneFrameThreadLag to false in your SystemSettings.ini. Does that do anything? It probably won’t make a difference if the hair is the only thing that’s lagging.

Nice idea, but I just tried it and unfortunately it did not fix it.

Currently I’m just switching the hair to a static mesh once the player starts moving on a vehicle. Very gross indeed…