don't think about it like the real world 3d spent shells are exact same thing as bullet, just in a different direction. 3d is really just the same as 2d but instead of a flat image it's a 3d mesh.
extends RigidBody3D
func _ready() -> void:
apply_force(Vector3i.UP*500,Vector3i.ZERO)
apply_force(Vector3i.RIGHT*500,Vector3i.ZERO)
func _on_timer_timeout() -> void:
queue_free()
so the scene for that needs to be a RigidBody3D with a timer under it set for 5 sec, a meshinstance3d with a new cylinder shape, and a collisionshap with a cylindershape, save it as bull_shell.tscn
extends Node3D
const Bull: PackedScene = preload("res://Scripts/bull_shell.tscn")
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("ui_accept"):
print("bang")
var BS:=Bull.instantiate()
BS.rotation_degrees=Vector3(90,0,0)
add_child(BS)
the scene for this needs a camera3d backset a bit so it can see vec 0, it needs a directional light3d
then just press space bar to fire
you would hook this up to your gun. maybe scale it down and mess with the BS.position = Vector3(0,0,0) to where it's where the gun would produce the spent shells