Overrides - Vaei/TurnInPlace GitHub Wiki

There are several overrides that can change the way Turn In Place behaves during runtime.

[!TIP] Make sure you have a derived UTurnInPlace component and that the Component Class on your character has been changed to the derived type. You can do this in either Blueprint or C++

Cache Updated Character

Override this if you want to cast to your own character and cache it for later use

Get Mesh

Override this if the mesh you turn isn't the mesh returned by ACharacter::GetMesh().

Get Turn Mode Tag

If you look at the Anim Set returned by your Animation Blueprint's ITurnInPlaceAnimInterface::GetTurnInPlaceAnimSet, you can change the TurnAngles on the Params. By default we include TurnMode.Movement and TurnMode.Strafe.

This allows you to add further turn modes to suit your own project, to define different Min Turn Angle and Max Turn Angle based on those turn modes.

Then override GetTurnModeTag to return the current Turn Mode you want to apply the turn angles for.

Override Turn In Place

Turn In Place has 3 modes.

  • Enabled -- Working as normal and will Turn in Place
  • Locked -- Will not rotate, maintains facing direction
  • Paused -- Acts as if there is no turn in place, very useful for montages

Override this to change the behaviour based on run-time conditions.

[!TIP] Montages are already handled by the parent function and will pause so long as it meets the requirements set out in your Anim Set Params.

[!IMPORTANT] You can add metadata curves to animations and montages to override the behaviour, by default these curves are named PauseTurnInPlace and LockTurnInPlace

Should Ignore Root Motion Montage

Root Motion Montages will pause the turn in place if it fails this check.

If you want to add exceptions to the existing system then you can override this. You probably won't need to.

Advanced Overrides

[!TIP] You do not need to override anything here unless you're using APawn instead of ACharacter

Is Playing Networked Root Motion Montage

Calls the equivalent function from ACharacter

Get Controller

Retrieves an AController that is only used for drawing debug arrows

Get Debug Draw Arrow Location

Gets the location at the base of the actor's capsule (their feet) to draw the arrows from, also has an out bool& parameter to determine if the location is valid or not.