fixed linear falloff
This commit is contained in:
@@ -41,9 +41,7 @@ func explode():
|
||||
for body in moveable_rigidbodies:
|
||||
if body.is_in_group("scene_rigidbody"):
|
||||
var blast_direction = (body.global_position - blast_radius.global_position).normalized()
|
||||
var blast_amount = (10 / (body.global_position - blast_radius.global_position).length()) / 10
|
||||
print("blast direction "+str(blast_direction))
|
||||
print("blast amount "+str(blast_amount))
|
||||
var blast_amount = 1 - ((body.global_position - blast_radius.global_position).length() / 10)
|
||||
var blast_velocity = blast_direction * blast_power * blast_amount
|
||||
if body.is_in_group("breakable"):
|
||||
body.breaking(blast_velocity)
|
||||
|
||||
Reference in New Issue
Block a user