Skip to content

Fix no sleeping#1

Open
jschiff wants to merge 3 commits into
mainfrom
no-sleep-patch1
Open

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

Conversation

@jschiff

@jschiff jschiff commented Apr 21, 2025

Copy link
Copy Markdown
Contributor

No description provided.

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

Copilot AI left a comment

Copy link
Copy Markdown

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;
}

Copilot AI Apr 21, 2025

Copy link

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