Fix bug with gravity being lost after menu
This commit is contained in:
1 parent
1858ca6288
commit
14b60c1e02
3 files changed
+11
-7
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user