玩家角色接触到敌人的攻击框的问题A question about when the player character comes into contact with an enemy's hitbox.

玩家角色接触到敌人的攻击框而受伤时,正面接触和背面接触都会同时有底部接触的问题。

When the player character is injured by coming into contact with the enemy’s attack box, both frontal and rear contact will simultaneously have the problem of bottom contact.

如图所示,我在脚本里设计了在玩家正面接触敌人时,控制台输出”正面受伤“;玩家底部接触敌人时,控制台输出”底面受伤“。

As shown in the figure, I designed in the script that when the player comes into contact with the enemy from the front, the console outputs “正面受伤”; when the player’s bottom comes into contact with the enemy, the console outputs “底面受伤”.

而此时玩家仅仅只是正面接触敌人,控制台同时输出了”正面受伤“和”底面受伤“两个信息。

But the player was merely in direct contact with the enemy from the front, and the console simultaneously displayed the messages “正面受伤” and “底面受伤”.

下面是一个简单的工程文件,可以进行检查。

Here is a simple game file that you can be checked.

damagetest_2025-10-21_21-45-52.zip (26.7 KB)

Thank you for the project files, we will investigate why this is happening.