14 lines
446 B
GDScript
14 lines
446 B
GDScript
extends Projectile
|
|
|
|
@onready var hit_ray: RayCast3D = $HitRay
|
|
@onready var land_depth: Marker3D = $LandDepth
|
|
|
|
func _process(delta: float) -> void:
|
|
|
|
if hit_ray.is_colliding():
|
|
var stick_point = hit_ray.get_collision_point()
|
|
if land_depth.global_position.distance_to(stick_point) > .2:
|
|
global_position += global_transform.basis * Vector3(0,0,-speed) * delta
|
|
else:
|
|
global_position += global_transform.basis * Vector3(0,0,-speed) * delta
|