-
-
Notifications
You must be signed in to change notification settings - Fork 38
Add NetworkArea nodes as physics extras #451
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
base: main
Are you sure you want to change the base?
Conversation
I will test this right now with godot physics stepping |
I'll test this out with rapier when I get a second |
Thank you both! 🚀 |
NetworkTime.on_tick.connect(_tick) | ||
|
||
|
||
func _tick(_d: float, tick: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This runs in the tick loop, yet the signals emitted are labeled as rollback. Could you please clarify?
@kumpmati is the example repo still up? I can't open it. |
Sorry I had made it private, it's now public again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things I should do still
|
||
|
||
## Returns the result of [method Area3D.get_overlapping_areas] at [param tick] | ||
func rollback_get_overlapping_areas(tick: int) -> Array[Area3D]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Godot can't automatically cast the values, so we need to either remove the type or use Array.assign
func rollback_get_overlapping_areas(tick: int) -> Array[Area3D]: | |
func rollback_get_overlapping_areas(tick: int) -> Array: |
return _overlapping_areas.get_snapshot(tick) if _overlapping_areas.has(tick) else [] | ||
|
||
## Returns the result of [method Area3D.get_overlapping_bodies] at [param tick] | ||
func rollback_get_overlapping_bodies(tick: int) -> Array[Node3D]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here and in the 2D version
func rollback_get_overlapping_bodies(tick: int) -> Array[Node3D]: | |
func rollback_get_overlapping_bodies(tick: int) -> Array: |
|
||
|
||
## Returns the result of [method Area3D.get_overlapping_areas] at [param tick] | ||
func rollback_get_overlapping_areas(tick: int) -> Array[Area3D]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also check if the area monitoring
is set to true before trying to access overlapping bodies/areas
No worries @kumpmati, take your time! I think this will be another great addition to netfox's featureset, so I don't mind waiting a bit 😄 Let me know if there's anything I can help with, I'm happy to write the docs! |
Related to #437
Physics rollback messes with Area2/3D
entered
andexited
signals, making them fire multiple times, especially with ping + CharacterBodies.The
NetworkArea2/3D
helper nodes introduce rollback-aware versions ofArea2/3D
signals and methods with arollback_
prefix.TODO:
Area2/3D
methods with rollback support