Closed akien-mga closed 8 years ago
For the record, staying near them for around 10-20 seconds (presumably busy with some puzzle) would awake them as well.
From what I could see they actually only wake up when touched/moving. It looks like the logic in _integrate_forces
only starts processing one the physics are triggered. Strangely enough the RigidBody2D doesn't claim to be sleeping, so so far the only workaround I could find was:
diff --git a/enemies/fluff/fluff.gd b/enemies/fluff/fluff.gd
index 634c7cc..cef447f 100644
--- a/enemies/fluff/fluff.gd
+++ b/enemies/fluff/fluff.gd
@@ -38,6 +38,7 @@ var dead = false
var spiked_count = 0
func _on_body_enter_spikes(body):
+ set_linear_velocity(get_linear_velocity()) # Wake up
if body extends preload("res://player/alpaca.gd"):
spiked_count += 1
Might be a regression in the logic due to newer Godot version, or maybe they were always like that, but it seems like they don't really behave as designed; they should trigger their attack/spikes mode when the player comes near them. Right now they trigger it only if you hit them on purpose to wake them up, making them hardly a threat.