I have a raycast checking if there is a wall or ceiling or floor around the player when they press the attack button. If there is, you move away from that wall until the raycast is no longer touching the wall. it is set to disabled and is enabled upon entering the attack state. It becomes disabled again whenever leaving the state. I'm using an animation tree and state machine to change the animation, depending on your direction relative to the wall. The raycast only becomes active once you start the attack. The problem is, the raycast becomes active right before updating to the correct direction. The animation itself changes (seemingly) right away, but the raycast pivot rotation does not update until a frame or so upon entering the attack state. So if I press the opposite direction right after attacking, it sees the raycast in the wall, but then moves toward the wall because the raycast moves to its new position a frame afterward. I've tried setting the raycast to disabled within the animation itself until a certain frame, but it still is active for a split second upon entering the state, and then will go inactive until the animation tells it to reactivate. It's as if the rotation can't possibly happen right away or something. I don't know why the animation itself would change but not the raycast rotation. Hopefully I'm just missing something super simple. I'm bad at explaining, but hopefully this is followable. Let me know if I should show a certain portion of code and I will. Thanks.
there's a video of it in action
I've fixed this but I'm unsure how to delete posts
Best would be to simply give an explanation what the actual issue was and how you resolved it.