Hard to say, however, I would place it directly after the event is called to come out of crouch. So for example if you are using an action input event for the C-key, you would place the tracing logic on the ‘Release’ event for the C-key, obviously before executing the actual ‘un-crouch’ function which would be called from the branch if your distance is greater than etc.