generated from krampus/template-godot4
20 lines
435 B
GDScript3
20 lines
435 B
GDScript3
|
extends Area3D
|
||
|
## World player hitbox
|
||
|
|
||
|
signal ball_collision(ball: GameBall)
|
||
|
|
||
|
@export var ignored_balls: Array[GameBall] = []
|
||
|
|
||
|
@onready var shot_setup: ShotSetup = $".."
|
||
|
@onready var physics_ball: GameBall = %PhysicsBall
|
||
|
|
||
|
|
||
|
func _on_ball_entered(ball: GameBall) -> void:
|
||
|
if not ball in ignored_balls:
|
||
|
ball_collision.emit(ball)
|
||
|
|
||
|
|
||
|
func _on_body_entered(body: Node3D) -> void:
|
||
|
if body is GameBall:
|
||
|
_on_ball_entered(body as GameBall)
|