Updating defaults values of probe
This commit is contained in:
parent
4eafcb6a8d
commit
801423fa51
1 changed files with 6 additions and 1 deletions
|
@ -4,11 +4,12 @@ extends Marker3D
|
|||
class_name BuyancyProbe
|
||||
|
||||
## 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
|
||||
var currentdepth:float
|
||||
|
||||
@export_category("Debug")
|
||||
@export var debug :bool = false
|
||||
@export var show_probe :bool = false:
|
||||
set(_value):
|
||||
show_probe = _value
|
||||
|
@ -31,8 +32,10 @@ var Oceantime:float
|
|||
|
||||
@onready var parentRigid:RigidBody3D = get_parent()
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
gizmo_extents = 1.0
|
||||
if ocean_mat != null:
|
||||
update_param()
|
||||
if show_probe:
|
||||
|
@ -52,6 +55,8 @@ func _physics_process(_delta: float) -> void:
|
|||
#parentRigid.gravity_scale = 0.3
|
||||
#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)
|
||||
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:
|
||||
if OceanNode != null:
|
||||
|
|
Loading…
Reference in a new issue