Hi guys, I’m using a custom movement component with very simple code like so (the most simple I can make at least)
UBasicVehicleMovementComponent::UBasicVehicleMovementComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void UBasicVehicleMovementComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// Make sure that everything is still valid, and that we are allowed to move.
if (!GetBasePawn() || !UpdatedComponent || ShouldSkipUpdate(DeltaTime))
{
return;
}
if (GetBasePawn()->CurrentSpeed != 0.0f)
{
FVector FinalVelocity = GetBasePawn()->GetActorForwardVector() * GetBasePawn()->CurrentSpeed * DeltaTime;
FHitResult Hit;
SafeMoveUpdatedComponent(Velocity, UpdatedComponent->GetComponentRotation(), true, Hit);
// If we bumped into something, try to slide along it
if (Hit.IsValidBlockingHit())
{
SlideAlongSurface(Velocity * DeltaTime, 1.0 - Hit.Time, Hit.Normal, Hit);
}
UpdateComponentVelocity();
}
};
class ARTSBasePawn* UBasicVehicleMovementComponent::GetBasePawn() const
{
return Cast<ARTSBasePawn>(PawnOwner);
}
If I get that and assign it to a pawn with collsion capsule, when requesting a path it will not use the nav mesh (GetImmediateMoveDestination just points straight at the final destination). Is there something I need to tick for it to use navmesh properly.
I’ve already set Can Walk to true.