Browse Source

Fix players becoming asleep and uncontrollable

master
Luna 7 years ago
parent
commit
e1d6e21280
2 changed files with 4 additions and 6 deletions
  1. +2
    -2
      scenes/player.tscn
  2. +2
    -4
      scripts/tp_camera.gd

+ 2
- 2
scenes/player.tscn View File

@ -29,7 +29,7 @@ radial_segments = 64
rings = 8 rings = 8
_sections_unfolded = [ "Resource" ] _sections_unfolded = [ "Resource" ]
[node name="RigidBody" type="RigidBody" index="0" groups=[
[node name="RigidBody" type="RigidBody" groups=[
"player", "player",
]] ]]
@ -47,7 +47,7 @@ continuous_cd = true
contacts_reported = 0 contacts_reported = 0
contact_monitor = false contact_monitor = false
sleeping = false sleeping = false
can_sleep = true
can_sleep = false
axis_lock_linear_x = false axis_lock_linear_x = false
axis_lock_linear_y = false axis_lock_linear_y = false
axis_lock_linear_z = false axis_lock_linear_z = false


+ 2
- 4
scripts/tp_camera.gd View File

@ -31,13 +31,11 @@ func _ready():
func set_enabled(enabled): func set_enabled(enabled):
if enabled: if enabled:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED); Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED);
set_process(true);
cam.make_current() cam.make_current()
is_enabled = true;
else: else:
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE); Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE);
set_process(false);
is_enabled = false;
set_process(enabled);
is_enabled = enabled;
func clear_exception(): func clear_exception():
collision_exception.clear(); collision_exception.clear();


Loading…
Cancel
Save