remotes/1705382094874458415/tmp_refs/heads/godot4-port
Jan 2020-09-14 00:25:53 +02:00
parent 9e0ab13079
commit 03402c7031
1 changed files with 8 additions and 1 deletions

View File

@ -79,8 +79,15 @@ func motion(delta):
debug.text += "\nslide count: " + String( self.get_slide_count() )
for i in range(0, self.get_slide_count() ):
debug.text += "\nslide " + String(i) + ": " + String( self.get_slide_collision(i).normal )
debug.text += "\nslide dot " + String(i) + ": " + String( self.get_slide_collision(i).normal.dot(velocity.normalized()) )
var dot_product = self.get_slide_collision(i).normal.dot(velocity)
debug.text += "\nslide dot " + String(i) + ": " + String( dot_product )
if dot_product < -2:
# Push represents the component vector pushing into the surface
var push = (dot_product + 50) * self.get_slide_collision(i).normal
debug.text += "\npush " + String(i) + ": " + String( push )
velocity -= push
func _physics_process(delta):
if str(get_tree().get_network_unique_id()) != name: