I want the bullet (ball) for a toy gun to bounce back normally

Godot Version

Godot4.4

Question

` so im applying a force to the rigidbody 3d (ball) but when it hits any thing it does not bounce correctly and after bouncing it just keeps going forward and stops slowly and sometime clips throw the ground and falls under level the code is very simple im new to godot so any help is appreciated

extends RigidBody3D
class_name Bullet_class

var bullet_speed : float = 120

func _physics_process(delta: float) → void:
var force = global_basis * Vector3.FORWARD * bullet_speed * delta
apply_impulse(force)

RigidBody3D.apply_impulse() is time-independent and won’t work correctly when applying it every frame. You should use RigidBody3D.apply_force() instead.

You can use RigidBody3D.physics_material_override to override the bounciness and friction of the body.

now when ever it hits something it flies like a balloon every where