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

DistanceCondition maximum distance is not respected when changed at runtime #809

Closed
gregharding opened this issue Nov 6, 2024 · 1 comment
Labels
Acknowledged Your issue has been acknowledged and will be investigated. Resolved Pending Release

Comments

@gregharding
Copy link
Contributor

gregharding commented Nov 6, 2024

General
Unity version: 6.0.25
Fish-Networking version: 4.5.4hf0R
Discord link: Discord message

Description
DistanceCondition maximum distance is not respected when changed at runtime as per the observer docs example. The cause is that internally the distance condition uses cached values like _sqrMaximumDistance which are not updated in the public property setter MaximumDistance.

Also, the example in the docs Modifying Conditions doesn't quite work either. The GetObserverCondition<DistanceCondition>() returns ObserverCondition so it needs to be cast to DistanceCondition before accessing the property.

Replication
Steps to reproduce the behavior:

  1. Update a DistanceCondition maximum distance as per the docs Modifying Conditions
  2. Observe that the observation distance does not change from its initial value.

Expected behavior
DistanceCondition maximum distance is correctly respected at runtime.

@FirstGearGames
Copy link
Owner

Resolved in 4.5.5.

FirstGearGames pushed a commit that referenced this issue Nov 8, 2024
- Fixed DistanceCondition.MaximumDistance not applying properly when set at runtime (#809).
- Obsoleted DistanceCondition.MaximumDistance.
- Added DistanceCondition.Get/SetMaximumDistance.
- Fixed predicted spawners not becoming an observer of the object they spawned.
- Fixed internals trying to call prediction methods on NetworkBehaviours when they do not utilize prediction when at least one NetworkBehaviour for the NetworkObject does.
- Fixed SyncTimers finishing immediately on clientsOnly when using timer.Update without arguments. (#807).
- Added TickNetworkBehaviour.SetTickCallbacks to set callbacks at runtime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Acknowledged Your issue has been acknowledged and will be investigated. Resolved Pending Release
Projects
None yet
Development

No branches or pull requests

2 participants