Fixed linear holding of items, still working on rotation
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user