So i have the floor:
also i have a block:
I have a bullet:
bullet code:
const SPEED = 5.0
@onready var bullet = $bullet_base
@onready var raycast = $RayCast3D
@onready var particles = $GPUParticles3D
func _process(delta):
bullet.position += bullet.transform.basis * Vector3(0,0,-SPEED) * delta
if raycast.is_colliding():
print(raycast.get_collider())
print("bullet_hit")
bullet.visible = false
particles.emitting = true
await get_tree().create_timer(1).timeout # <---- timer
queue_free()
bullet raycast settings:
And the logic is like: when bullet have collision with the floor or block -> it will be destroyed and particles appears.
But instead of logic above i have this:
if be short, i don't understand how collisions works here, i don't like how it's made.
is there some actions like "on collision" or "if object have collision"? (except the area3D call)