making level
This commit is contained in:
parent
d2e2276d43
commit
4ab01fe0dc
15 changed files with 173 additions and 58 deletions
|
|
@ -1,4 +1,5 @@
|
|||
extends Node3D
|
||||
class_name Player
|
||||
|
||||
var playerObject
|
||||
|
||||
|
|
@ -6,12 +7,17 @@ func _ready() -> void:
|
|||
GlobalVariables.player = self
|
||||
playerObject = $Horse
|
||||
|
||||
func get_object_position():
|
||||
return playerObject.global_position
|
||||
|
||||
func change_object(object):
|
||||
var objectPosition = playerObject.position
|
||||
var objectRotation = playerObject.objectRotation
|
||||
var objectRotation = playerObject.rotation
|
||||
var objectVelocity = playerObject.linear_velocity
|
||||
remove_child(playerObject)
|
||||
|
||||
add_child(object)
|
||||
object.position = objectPosition
|
||||
object.position = objectPosition + Vector3(0, 2, 0)
|
||||
object.rotation = objectRotation
|
||||
object.linear_velocity = objectVelocity
|
||||
playerObject = object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue