I’m trying to make an RTS style game and I want to have my unit pawns move towards where I right click. I have that, but currently they’re teleporting (or moving really, really fast) there and adjusting the speed in the floating pawn movement component doesn’t seem to help. I’m using Simple Move To Location function and passing it the mouse impact point and the AI Controller that’s controlling the unit.
UPDATE EDIT:
Just an update on this: I switched to using ACharacter
(with a UCharacterMovementComponent
) for a while, before ultimately deciding that it didn’t suit my needs. I’ve switched back to UFloatingPawnMovement
and am once again having trouble with this issue. Clicking anywhere on the navmesh causes the pawn to instantaneously appear there, regardless of speed values.
In my C++ class, I’m deriving from APawn
and I have a UFloatingPawnMovement* UnitMovement
field, and in the constructor I’m using CreateDefaultSubobject
and assigning it to the field. I’ve overridden the UPawnMovementComponent* APawn::GetMovementComponent() const
function in my new class and set it to return UnitMovement
. I switched from using AAIController::SimpleMoveToLocation()
to simply, AAIController::MoveToLocation()
and AAIController::MoveToActor()
None of these things have managed to fix the issue though, so I’m unmarking my answer and bumping this question.
To reiterate: How can I have a pawn AI use the navmesh with either UFloatingPawnMovement
or a custom movement component?