Should player input be caught in Update, and then raycasting in FixedUpdate for shooting mechanics?

I currently have the code checking for player to be aiming, reloading, in Update, but firing in FixedUpdate. But as all of these can affect shooting, I feel like they should all be in the same function, and RayCasting is supposed to be done in FixedUpdate.

Is it okay to mix Update and FixedUpdate? Or should I throw the code in the same function?

There’s nothing inherently wrong with mixing between Update and FixedUpdate, and is likely done any time there’s physical movement in a game.

In general, Update should be where input checking is done, along with non-physical movements so it matches the framerate. Anything physics should be done in FixedUpdate when possible, since it matches the physics engine update.

Keychecking is done in Update normally, due to things like GetKeyDown only showing true for one frame, so it can be easily missed with FixedUpdate. If the key needs to trigger a physics reaction like jumping, a bool is set in Update that is used and reset in FixedUpdate.

You mention Raycasting for firing. If you’re not actually affecting a physical object (instantiating a bullet, applying knockback, etc), then there’s no issue with doing it during Update since Raycasting doesn’t directly affect anything physics.