Godot Version
v4.3.stable.official [77dcf97d8]`
Question
here is my projectile’s full code:
extends Node3D
#VVV Bullet settings yay \OvO/
const damage = 15
const speed = 600.0
@onready var mesh = $MeshInstance3D
@onready var ray1 = $RayCast3D
#@onready var ray2 = $ShapeCast3D
@onready var particles = $GPUParticles3D
#@onready
func _ready(): #nothing here lol
pass
func _physics_process(delta): #Bullet position, particle effects, and consistant hit reg are handles here (no consistant hit reg yet ;-;)
position += transform.basis * Vector3(0, +speed, 0) * delta
if ray1.is_colliding():
mesh.visible = false
particles.emitting = true
await get_tree().create_timer(5).timeout
queue_free()
# if ray2.is_colliding():
# mesh.visible = false
# particles.emitting = true
# await get_tree().create_timer(5).timeout
# queue_free()
func _process(delta):
pass
func _on_timer_timeout():
queue_free()
my issue is that my projectile at higher speeds goes through a collision shape before the raycast detects it, resulting in it not colliding properly. my physics speed i set to 150, my max physics steps per frame is set to 16, and physics interpolation is on. any advice, suggested tweaks, or even forbidden coding wizard shit, would be very appreciated.