Updating defaults values of probe

This commit is contained in:
Lucas 2025-04-07 12:32:21 +02:00
parent 4eafcb6a8d
commit 801423fa51
No known key found for this signature in database

View file

@ -4,11 +4,12 @@ extends Marker3D
class_name BuyancyProbe class_name BuyancyProbe
## How much force is applied upward ## How much force is applied upward
@export var float_strength: float = 10.0 @export var float_strength: float = 1.0
@export var max_float_force:float = 500.0 @export var max_float_force:float = 500.0
var currentdepth:float var currentdepth:float
@export_category("Debug") @export_category("Debug")
@export var debug :bool = false
@export var show_probe :bool = false: @export var show_probe :bool = false:
set(_value): set(_value):
show_probe = _value show_probe = _value
@ -31,8 +32,10 @@ var Oceantime:float
@onready var parentRigid:RigidBody3D = get_parent() @onready var parentRigid:RigidBody3D = get_parent()
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready() -> void: func _ready() -> void:
gizmo_extents = 1.0
if ocean_mat != null: if ocean_mat != null:
update_param() update_param()
if show_probe: if show_probe:
@ -52,6 +55,8 @@ func _physics_process(_delta: float) -> void:
#parentRigid.gravity_scale = 0.3 #parentRigid.gravity_scale = 0.3
#parentRigid.angular_damp = 15.0 #parentRigid.angular_damp = 15.0
parentRigid.apply_force(Vector3.UP * clamp(gravity * depth * float_force,-max_float_force,max_float_force) ,global_position-parentRigid.global_position) parentRigid.apply_force(Vector3.UP * clamp(gravity * depth * float_force,-max_float_force,max_float_force) ,global_position-parentRigid.global_position)
if debug:
print(str(self)+" is applying a force of "+str(Vector3.UP * clamp(gravity * depth * float_force,-max_float_force,max_float_force) ,global_position-parentRigid.global_position)+"to "+str(parentRigid))
func _process(_delta: float) -> void: func _process(_delta: float) -> void:
if OceanNode != null: if OceanNode != null: