How do i apply an impulse once?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ExcelsiorStretch

This is the function i used on the Bullet node which is a rigidbody.

func ready(delta):
if Input.is_action_just_pressed(“space”):
apply_impulse(global_transform.origin, Vector3.UP)
#apply_central_impulse(global_transform.basis.z * muzzle_velocity)
#look_at(transform.origin + velocity.normalized(), Vector3.UP)
#transform.origin += velocity * delta

I mixed and matched all different methods? i think theyre called, like _integrate_forces and _physics_process with many different lines of code.

This is in the _physics_process of the cars rigidbody.

if Input.is_action_just_pressed("space"):
	var b = preload("res://scenes/Bullet.tscn").instance()
	apply_impulse(global_transform.origin, Vector3.UP)
	b.transform = $Position3D.global_transform
	#b.velocity = b.transform.basis.z * b.muzzle_velocity

I have a dreidal and a fidget spinner with this code:

func _physics_process(delta):

(really fun to run over in the car)


I started a few days ago, i feel like i managed to get to the gist of most everything up to this point. I would like the bullet to fly at a rigidbody hit it and fall down.
Cant figure it out. Ive done a lot of googling and such in the past few days to get this far lol (pain). The bullets either fly all over, float or hit the object and stay there kinda looking
like a bee hovering at a flower. Or a hummingbird.

My best guess would be that the function on the bullet is running constantly while the bullet after i spawn it in with the space bar so i would need to create a script
with the function on it and do a function call from the bullet to that script which only gets called once. the floating may have to do with editing the transform in the script
but i need to set the transform so it aims and goes the right way. Whatever i got stuck on the other day seems like a cakewalk compared to this lol. Oh im brand new to coding and gamedev.
talk to me like a 10 yr old