Hello. I’ve faced a problem which I’m not able to solve by myself. I’ve created new class derived from APawn class, then I’ve made my custom movement component from UPawnMovementComponent. Then I set everything up like it was done in default pawn and copied some code from floating Movement Component:
FHitResult Hit(1.f);
SafeMoveUpdatedComponent(Delta, Rotation, true, Hit);
if (Hit.IsValidBlockingHit())
{
HandleImpact(Hit, DeltaTime, Delta);
// Try to slide the remaining distance along the surface.
SlideAlongSurface(Delta, 1.f - Hit.Time, Hit.Normal, Hit, true);
}
This all 100% called every frame, but there is no collision presence. Further investigation led me to some strange code in USceneComponent::MoveComponent:
// Fill in optional output param. SceneComponent doesn't sweep, so this is just an empty result.
if (OutHit)
{
*OutHit = FHitResult(1.f);
}
So as I understand I need to override this function, but there is nothing like that in defaultPawn and everything works just fine. Did I miss something there?