Forum rules - please read before posting.

Question about Player movement and fixed update (fixed timestep)

Hi,

Is there anywhere in the AC player movement or First Person Camera scripts that are running in fixed update? Reason I ask is that I just released my game, Discolored, on Steam and a couple people mentioned they noticed stuttering when moving around the scene. The movement method is First Person and I'm using the rigidbody to move the player and the Interpolate setting is set to Interpolate.

Some things I did to help fix the issue is I changed the fixed timestep in the Unity settings to 0.0167 (60fps) from the default 0.02 (50fps) so now anything running fixed update should match Update if running at 60fps. I also have Vsync enabled. Things look good on my end, but it seems some people still are running into stutter issues. My thinking is maybe they have a higher end monitor one that runs above 60hz so the Update and FixedUpdate are out of sync on that hardware with Vsync enabled (fixed update is at 60fps, but with Vsync enabled Update would be a higher number if I'm thinking about this correctly). So I was wondering if anything is running on fixed update in the player movement scripts and if changing those to run on Update instead would help address the issue. Hope this makes sense.

Thanks!

Comments

  • Rigidbody-based character motion is handled by applying forces to it, and yes - this is performed in FixedUpdate. This is as it shoud be, though - FixedUpdate is intended for the application of forces.

    The presence of a Rigidbody on the character is not enough for AC to make use of it, though: you have the Move with Rigidbody? option also checked in the Player Inspector?

    One thing to bear in mind is that you can alternatively rely on a Character Controller component instead of the Rigidbody / Capsule Collider combination. If you want the character to move in Update, this would be the way to go.

  • Thanks, Chris! Using a Character Controller instead worked perfectly.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.