Fixed linear holding of items, still working on rotation

This commit is contained in:
derek
2024-11-13 11:55:37 -06:00
parent 90bc6411d4
commit 554c2e8110
3 changed files with 26 additions and 22 deletions

View File

@@ -1,8 +1,10 @@
extends RigidBody3D
@export var broken_object : Resource
@export var break_velocity : float = 10
var break_on_land : bool = false
var held_currently : bool = false
# Called when the node enters the scene tree for the first time.
func _ready():
@@ -11,7 +13,7 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if linear_velocity.length() >= 10:
if linear_velocity.length() >= break_velocity and !held_currently:
break_on_land = true
func breaking(current_velocity):