diff --git a/BodyConfig/bodyBuildingScript.gd b/BodyConfig/bodyBuildingScript.gd index f62638c..1b5f2f6 100644 --- a/BodyConfig/bodyBuildingScript.gd +++ b/BodyConfig/bodyBuildingScript.gd @@ -25,8 +25,6 @@ signal start_fight() # Called when the node enters the scene tree for the first time. func _ready(): - _default_grav = PhysicsServer.area_get_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY) - PhysicsServer.area_set_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY, 0) _torso = get_node(torsoPath) as RigidBody _camera = get_node(cameraPath) as Camera _rayCast = get_node(rayCastPath) as RayCast @@ -34,6 +32,9 @@ func _ready(): func _process(delta): + # TODO: Would be nicer to just disable gravity, but then it can't be re-enabled... + _torso.translation = Vector3.ZERO + if _viewRot: var mouse_pos = get_viewport().get_mouse_position() @@ -122,6 +123,4 @@ func delete_body_part(): func _on_Start_pressed(): - PhysicsServer.area_set_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY, _default_grav) - emit_signal("start_fight", _torso) diff --git a/Controllers/GameStateController.gd b/Controllers/GameStateController.gd index 9878b15..636dabf 100644 --- a/Controllers/GameStateController.gd +++ b/Controllers/GameStateController.gd @@ -52,11 +52,16 @@ func _switch_to_win(player_id): func _switch_to_fighting(torso): _body_build_scene.remove_child(torso) + torso.global_transform.origin = Vector3.ZERO torso.translation += Vector3(0, 3, 0) - torso.rotation = Vector3(0, 0, 0) + torso.rotation = Vector3.ZERO _switch_scene(_fighting_scene, "fight_scene") _fighting_scene.add_child(torso) + + torso.axis_lock_linear_x = false + torso.axis_lock_linear_y = false + torso.axis_lock_linear_z = false func _switch_to_body_build(): diff --git a/Global/BodyPartLoader.gd b/Global/BodyPartLoader.gd index ca049d6..d4667a6 100644 --- a/Global/BodyPartLoader.gd +++ b/Global/BodyPartLoader.gd @@ -4,5 +4,5 @@ var bodyparts : Dictionary # Called when the node enters the scene tree for the first time. func _ready(): - bodyparts["Arm"] = load("res://BodyParts/Arm.tscn") - bodyparts["Humanleg"] = load("res://BodyParts/HumanLeg.tscn") + bodyparts["Human Arm"] = load("res://BodyParts/HumanArm.tscn") + bodyparts["Human Leg"] = load("res://BodyParts/HumanLeg.tscn")