Skip to content

Commit 7670afc

Browse files
committed
Direct player attack lower by target's half height
To make sure it always hits the target.
1 parent a6676fd commit 7670afc

File tree

1 file changed

+2
-1
lines changed
  • scripts/data/integration_tests/test_lua_api

1 file changed

+2
-1
lines changed

scripts/data/integration_tests/test_lua_api/player.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ testing.registerLocalTest('playerWeaponAttack',
315315
self.controls.run = true
316316
self.controls.movement = 1
317317
else
318-
destination = targetActor.position
318+
local halfExtents = types.Actor.getPathfindingAgentBounds(targetActor).halfExtents
319+
destination = targetActor.position - util.vector3(0, 0, halfExtents.z)
319320

320321
if nextTime < time then
321322
if use == 0 then

0 commit comments

Comments
 (0)