-
-
Notifications
You must be signed in to change notification settings - Fork 60
RewindableAction.set_active() will not execute in tick when rbs cannot simulate. #517
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
🐛 Description
A RewindableAction will confirm multiple times even only emit set_active(true) once when enable_prediction is not toggled.
Further more, the value of _active_ticks in r-act is different between two states.
Steps to reproduce
By creating a rollback npc without enable prediction, we can see has_confirmed() will produce different behaviours with different enable_prediction states.
extends CharacterBody2D
@onready var rewindable_action = $RewindableAction
func _after_loop() -> void:
if rewindable_action.has_confirmed():
if not multiplayer.is_server():
print("confirmed")
func _enter_tree():
if Engine.is_editor_hint(): return
NetworkTime.after_tick_loop.connect(_after_loop)
func _exit_tree():
if Engine.is_editor_hint(): return
NetworkTime.after_tick_loop.disconnect(_after_loop)
func _rollback_tick(dt, _tick, _is_fresh: bool):
rewindable_action.set_active(_tick == 30 * 10)Toggle enable_prediction to see diferent behaviours.
Additionally, see mre.
Expected behavior
Log only once for both situtations.
Observed behavior
Output:
confirmed * 1, enable_prediction = true
confirmed * 52, enable_prediction = false
Versions
- Godot version: Godot v4.4.1.stable.mono, Godot v4.1.3
- netfox version: 1.33.1
Notes
MRE
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working