Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: NetworkRigidbody2D not changing body type with authority [MTT-8510] #2916

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented May 6, 2024

This PR resolves the issue with NetworkRigidbody2D not changing the Rigidbody2D body type with a change in authority.
(does not require up-port to v2.0.0 as this issue is already fixed with the updated NetworkRigidbodyBase)

MTT-8510

fix: #2915

Changelog

  • Fixed: Issue where NetworkRigidbody2D would not properly change body type based on the instance's authority when spawned.

Testing and Documentation

  • Includes integration tests.
  • No documentation changes or additions were necessary.

This resolves the issue with Rigidbody2d not changing the body type based on changes to authority while also assuring the initial body type for Rigidbody2d is kinematic until spawned.
Realized we needed an overhaul with our rigid body tests so I did a bit of refactoring.
Added temporary internal method, OnSetupRigidbody, to both network rigid body components and will circle back to this test once the prespawn PR is merged to replace it with the NetworkBehaviour.OnNetworkPreSpawn.

Deleted the remaining of the completely commented out rigid body tests that are now being covered in the NetworkRigidbodyTests.
removing whitespaces
Adding changelog entry
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review May 6, 2024 17:59
@NoelStephensUnity NoelStephensUnity requested review from chrispope, miniwolf and a team as code owners May 6, 2024 17:59
@NoelStephensUnity NoelStephensUnity changed the title fix: NetworkRigidbody2D not changing body type with authority fix: NetworkRigidbody2D not changing body type with authority [MTT-8510] May 6, 2024
Replacing OnSetupRigidbody with OnNetworkPreSpawn
Copy link
Collaborator

@miniwolf miniwolf left a comment

Choose a reason for hiding this comment

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

LGTM

@NoelStephensUnity NoelStephensUnity merged commit bcb891b into develop May 9, 2024
24 checks passed
@NoelStephensUnity NoelStephensUnity deleted the fix/networkrigidbody2d-not-changing-bodytype-with-authority branch May 9, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants