Skip to content

Fix no sleeping#1

Open
jschiff wants to merge 3 commits intomainfrom
no-sleep-patch1
Open

Fix no sleeping#1
jschiff wants to merge 3 commits intomainfrom
no-sleep-patch1

Conversation

@jschiff
Copy link
Copy Markdown
Contributor

@jschiff jschiff commented Apr 21, 2025

No description provided.

@jschiff jschiff requested a review from Copilot April 21, 2025 17:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to fix the "no sleeping" behavior by updating the conditions in the FixedUpdate method of BetterRigidbody.cs.

  • Updated the condition in FixedUpdate to only apply exempted velocity changes when the value is nonzero and the rigidbody is not kinematic.
  • Moved the reset of _exemptedVelocityChange into the conditional block.

Comment on lines +63 to 64
_exemptedVelocityChange = Vector3.zero;
}
Copy link

Copilot AI Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current condition may prevent _exemptedVelocityChange from being reset when _rb.isKinematic is true, potentially leaving stale data for future frames. Consider resetting _exemptedVelocityChange outside the conditional block to ensure it is always cleared.

Suggested change
_exemptedVelocityChange = Vector3.zero;
}
}
_exemptedVelocityChange = Vector3.zero;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants