2024-02-27 17:39:47 +02:00
|
|
|
extends Area3D
|
|
|
|
class_name TouchBody3D
|
|
|
|
|
|
|
|
@export var plane = Plane.PLANE_XZ
|
|
|
|
|
|
|
|
func _ready():
|
2024-03-07 15:21:31 +02:00
|
|
|
set_collision_layer_value(1, false)
|
|
|
|
set_collision_layer_value(3, true)
|
|
|
|
|
2024-02-27 17:39:47 +02:00
|
|
|
var collisionShape = null
|
|
|
|
|
|
|
|
for child in get_children():
|
|
|
|
if child is CollisionShape3D:
|
|
|
|
collisionShape = child
|
|
|
|
break
|
|
|
|
|
|
|
|
if collisionShape != null:
|
|
|
|
plane.d = collisionShape.shape.size.y / 2 + collisionShape.position.y
|