[UE4]BUG 记录-20201109
按键映射问题
写了连射的代码后发现无法射击了,但是单独调用Fire()函数是可以执行的,但是在
GetWorldTimerManager().SetTimer(TimerHandle_TimeBetweenShots, this, &ASWeapon::Fire, TimeBetweenShots, true, FirstDelay);
里面,Fire()函数不会被调用,一开始以为是名字或者参数填错了,但是编译可以通过
最后查到的问题
按键绑定里面填了两个Press,导致每次点按都会自动把时间的句柄Clear掉,靠
PlayerInputComponent->BindAction("Fire", IE_Pressed, this, &ASCharacter::StartFire);
PlayerInputComponent->BindAction("Fire", IE_Released, this, &ASCharacter::StopFire);
本文解决了一个UE4游戏中关于按键映射导致的射击功能失效问题。通过调整按键绑定,避免了因重复绑定引起的计时器句柄被清除的情况。

4724

被折叠的 条评论
为什么被折叠?



