I have a custom movement component based on UFloatingPawnMovement
which works like this:
if (ShouldSkipUpdate(DeltaTime))
{
return;
}
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
if (!PawnOwner || !UpdatedComponent)
{
return;
}
RotateVelocity(DeltaTime);
const FVector PositionDelta = CalculatePositionDelta(DeltaTime);
const FRotator RotationDelta = CalculateRotationDelta(DeltaTime);
const FQuat NewRotation = UpdatedComponent->GetComponentQuat() * FQuat(RotationDelta);
FHitResult Hit(1.0f);
SafeMoveUpdatedComponent(PositionDelta, NewRotation, true, Hit);
if (Hit.IsValidBlockingHit())
{
HandleImpact(Hit, DeltaTime, PositionDelta);
SlideAlongSurface(PositionDelta, 1.0f - Hit.Time, Hit.Normal, Hit, true);
}
UpdateComponentVelocity();
I also have a custom model made in blender which looks like this:
It has a root bone and two bones for the wings. The root bone has no rotation on it. When I add physics bodies to the root bone everything is fine, but when I add them to the child bones things start breaking - the player starts colliding as if there were additional physics bodies, which I didn’t add (which are invisible in the debug view). Here is a screenshot of the character colliding, even though the debug view shows it shouldn’t (the wings are attached with flexible constrains, so they would bend if they were actually colliding here).
What might be the source of the issue? Is is something with the physics asset/mesh or with my code?