蹲下站起功能
//蹲下
void MyCrouch();
//站起
void MyUnCrouch();
.cpp文件里实现蹲下和站起方法
//蹲下
void AMyCharacter::MyCrouch()
{
Crouch();
}
//站起
void AMyCharacter::MyUnCrouch()
{
UnCrouch();
}
绑定蹲下站起按键 和 方法
//绑定蹲下
PlayerInputComponent->BindAction("Crouch",IE_Pressed,this,&AMyCharacter::MyCrouch);
//绑定站起
PlayerInputComponent->BindAction("Crouch",IE_Released,this,&AMyCharacter::MyUnCrouch);