Table of Contents

Class PickUpApproachTests

Namespace
GrindFest
Assembly
GrindFest.dll

Walking to an item before picking it up - the half of pick-up that no other test exercises.

public class PickUpApproachTests : DevTest
Inheritance
object
PickUpApproachTests
Inherited Members

Remarks

Every other pick-up test drops its item one metre in front of the hero, i.e. already inside the pickup skill's range, so BotHero.PickUp never has to walk anywhere and the movement code is never reached. The owner reported on 2026-09-20 that in a real session the hero walks past items instead of stopping at them ("jakoby vždycky přejdeme dál"), and gets worse when the game stutters.

So this test puts the item 7 m away on purpose and then, every quarter second while the hero walks, logs what the movement is actually doing: how far it still is, whether MovementState is even the current state, and - the one that matters most - how far the NavMeshAgent's own position has drifted from the transform. Movement is animation root motion with Agent.updatePosition = false, so the agent only knows where the hero is because OnAnimatorMove copies the transform into Agent.nextPosition; if that copy stops happening, the agent plans from a stale position and steers the hero by a direction that is no longer true - which is exactly what "walks past it" looks like from the outside.

It is diagnostic first and an assertion second: the run's log file is the point, and the failure message carries the closest approach so an overshoot is visible as a number.

Methods

WalkToItemOutOfRangeThenPickItUp()