Interlopating the physics of a Bullet's position (and/or collision)

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.

Please update your post to use preformatted text for code snippets with ```.

The issue is because you’re essentially teleporting your bullet from one place to another. If it’s fast enough, it will teleport through the object it’s supposed to collide with.
Try using CharacterBody3D with move_and_slide() instead.

So replace the MeshInstance3D with a CharacterBody3D, got it. and then for the move_and_slide() do something like this?

position += void.move_and_slide(void.transform.basis * Vector3(0, +speed, 0) * delta)