fixed bug where piece isnt being removed from old poretal
This commit is contained in:
parent
dbb0b693b9
commit
a7b359f8be
1 changed files with 6 additions and 4 deletions
|
|
@ -69,10 +69,6 @@ func animate_portal_teleport(piece: Pawn, origin_container: PieceContainer, dest
|
||||||
step2_tween.parallel().tween_property(piece, "modulate", fade_color, 0.3)
|
step2_tween.parallel().tween_property(piece, "modulate", fade_color, 0.3)
|
||||||
await step2_tween.finished
|
await step2_tween.finished
|
||||||
|
|
||||||
# Step 3: Reparent to destination container
|
|
||||||
# origin_container.remove_child(piece)
|
|
||||||
# destination_container.add_child(piece)
|
|
||||||
|
|
||||||
# Position at target portal center
|
# Position at target portal center
|
||||||
var target_portal_center = other_portal.base_button.global_position + (other_portal.base_button.size / 2)
|
var target_portal_center = other_portal.base_button.global_position + (other_portal.base_button.size / 2)
|
||||||
piece.global_position = target_portal_center
|
piece.global_position = target_portal_center
|
||||||
|
|
@ -90,6 +86,12 @@ func animate_portal_teleport(piece: Pawn, origin_container: PieceContainer, dest
|
||||||
# Reset z-index
|
# Reset z-index
|
||||||
piece.z_index = original_z_index
|
piece.z_index = original_z_index
|
||||||
|
|
||||||
|
# Step 3: Reparent to destination container
|
||||||
|
# origin_container.remove_child(piece)
|
||||||
|
# destination_container.add_child(piece)
|
||||||
|
destination_container.set_piece(piece, false)
|
||||||
|
origin_container.remove_piece(true)
|
||||||
|
|
||||||
func update_appearance() -> void:
|
func update_appearance() -> void:
|
||||||
if is_effect_active() && base_button:
|
if is_effect_active() && base_button:
|
||||||
var style = StyleBoxFlat.new()
|
var style = StyleBoxFlat.new()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue