Refine character animation and fishing presentation
This commit is contained in:
parent
81f5010ad2
commit
c596b2aee7
15 changed files with 403 additions and 402 deletions
|
|
@ -7,12 +7,25 @@ const PlayerScene: PackedScene = preload("res://player/player.tscn")
|
|||
static func instantiate_visuals() -> Node3D:
|
||||
var source: Player = PlayerScene.instantiate()
|
||||
var visuals := source.get_node("Visuals") as Node3D
|
||||
var source_rod_attachment: Node = visuals.find_child(
|
||||
"FishingRodAttachment", true, false
|
||||
)
|
||||
var source_rod_parent: Node = null
|
||||
var source_rod_index: int = -1
|
||||
if source_rod_attachment != null:
|
||||
source_rod_parent = source_rod_attachment.get_parent()
|
||||
source_rod_index = source_rod_attachment.get_index()
|
||||
source_rod_attachment.owner = null
|
||||
source_rod_parent.remove_child(source_rod_attachment)
|
||||
var presentation := visuals.duplicate(
|
||||
Node.DUPLICATE_SIGNALS
|
||||
| Node.DUPLICATE_GROUPS
|
||||
| Node.DUPLICATE_SCRIPTS
|
||||
| Node.DUPLICATE_USE_INSTANTIATION
|
||||
) as Node3D
|
||||
if source_rod_attachment != null and source_rod_parent != null:
|
||||
source_rod_parent.add_child(source_rod_attachment)
|
||||
source_rod_parent.move_child(source_rod_attachment, source_rod_index)
|
||||
source.free()
|
||||
presentation.name = "PlayerVisuals"
|
||||
return presentation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue