18 lines
374 B
GDScript
18 lines
374 B
GDScript
extends Node3D
|
|
|
|
var playerObject
|
|
|
|
func _ready() -> void:
|
|
GlobalVariables.player = self
|
|
playerObject = $Horse
|
|
|
|
func change_object(object):
|
|
var objectPosition = playerObject.position
|
|
var objectRotation = playerObject.objectRotation
|
|
remove_child(playerObject)
|
|
|
|
add_child(object)
|
|
object.position = objectPosition
|
|
object.rotation = objectRotation
|
|
playerObject = object
|