APawn Support - Vaei/TurnInPlace GitHub Wiki
[!CAUTION] Advanced C++ Users Only ActorTurnInPlace Version >= 1.1.0 Read every word, don't skim this guide, be warned you will lose a lot of time if you miss anything
[!NOTE] When Mover 2.0 is stable, usable for Player Characters, and actually a good upgrade/alternative to CMC Then official support will be added -- however that doesn't seem to be in the near future
[!IMPORTANT] This guide has information on how to support
APawn
rather thanACharacter
+UCharacterMovementComponent
The implementation will depend on yourAPawn
and you will need to figure out where to make the equivalent calls forACharacter::FaceRotation()
and/orUCharacterMovementComponent::PhysicsRotation()
yourself TheUTurnInPlace::TurnInPlace()
function is generic and should support anyAPawn
, theFaceRotation()
andPhysicsRotation()
functions are much less important when your Pawn is standing still as they typically reroute intoTurnInPlace()
then exit out
Mandatory Minimum Overrides
CacheUpdatedCharacter()
to cast GetOwner()
to your custom APawn
(and cache it for later)
GetTurnMethod()
to route to either FaceRotation()
or PhysicsRotation()
based on how/where you update rotation
FaceRotation is used for Strafe Direct (bUseControllerRotationYaw)
PhysicsRotation is used for Orient to Movement (bOrientRotationToMovement) and Strafe Desired (bUseControllerDesiredRotation)
Recommended Overrides
GetTurnModeTag()
otherwise it will return FTurnInPlaceTags::TurnMode_Movement
( TurnMode.Movement
)
IsPlayingNetworkedRootMotionMontage()
if you want root motion montage handling
GetMesh()
otherwise it will be the first returned by GetOwner()->FindComponentByClass<USkeletalMeshComponent>()
GetController()
otherwise debugging functions won't work -- not actually required to have a controller
GetDebugDrawArrowLocation()
otherwise debugging functions won't work -- this is generally where your actor's feet are, where debug arrows are drawn from
FaceRotation()
( C++ only ) to update rotation based on your own pawn instead of ACharacter::FaceRotation()
method
PhysicsRotation()
( C++ only ) to update rotation based on your own movement component instead of UCharacterMovementComponent::PhysicsRotation()
method
Continuation
You will need to observe the existing implementation and determine what the equivalent implementation for your own APawn
is to achieve the correct result, and this will be completely different based on your APawn
so no further instruction can be provided.