πββοΈCharacter
In this section you will learn how to implement FPSAnimController
Step 1 - Implement FPSAnimController
Inherit your controller from FPSAnimController
public class FPSController : FPSAnimController // <-
{
...
}Methods and properties
// Mostly used internally
protected void InitAnimController()
// Used to initialize the system and pending components
// @cameraDelegate - your function for the camera update
protected void InitAnimController(CoreToolkitLib.PostUpdateDelegate cameraDelegate)
// Used to initialize weapon-related data, such as sway, viewmodel, etc.
protected void InitWeapon(FPSAnimWeapon weapon)
// Used to initialize active aim transform
// Used by the Ads Layer
protected void InitAimPoint(FPSAnimWeapon weapon)
// Should be called every frame in the end of the player update loop
protected void UpdateAnimController()
// Used to play a recoil shake when firing
protected void PlayCameraShake(FPSCameraShake shake)
// Used to play a static pose
protected void PlayPose(AnimSequence motion)
// Used to play dynamic animation from code
protected void PlayAnimation(AnimSequence motion, float startTime = 0f)
// Used to stop currently playing animation
protected void StopAnimation(float blendTime = 0f)Use examples
InitAnimController(PostUpdateDelegate cameraDelegate)
InitWeapon(FPSAnimWeapon weapon)
InitAimPoint(FPSAnimWeapon weapon)
UpdateAnimController()
PlayCameraShake(FPSCameraShake shake)
PlayAnimation(AnimSequence motion)
StopAnimation(float blendTime = 0f)
Step 2 - Refresh input
Leaning
Movement
Look
Step 3 - Refresh RecoilAnimation
Update isAiming
Call Play and Stop
Last updated