英文:
Unreal Enginge Toggle / Hold to sprint problem
问题
我是新手使用虚幻引擎和制作游戏。我需要帮助解决这个问题,我似乎无法自己解决它。如何使得按住Shift来进行冲刺,而不是Shift切换冲刺?
我尝试了一些实验,但最终只是出现了错误。似乎在谷歌上也找不到解决方案。
英文:
I am new to unreal engine and game-making overall. I need help with this issue I can't seem to fix it myself. How do I make it so that I hold shift to sprint instead of shift toggling sprint?
I've tried experimenting but I only end up with errors. Can't seem to find a solution by googling.
答案1
得分: 1
当Shift键被按下时,将“Running”标志设置为true,并更新速度以反映玩家正在奔跑;当Shift键释放时,将其设置为false(并相应降低玩家速度)是最简单的方法。
英文:
The easiest way would be to use both the Pressed
and Released
events: when shift is pressed
, set the Running
flag to true and update the speed to reflect that the player is running, and when the shift key is Released
just set it to false (and lower the player speed accordingly)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论