Apply vibrate to Vehicle3d object

Godot Version

4.3

Question

I’m fairly new to Godot. I am trying to make a Vehicle3d object vibrate (to indicate a powerful engine revving up for example), and I’ve tried a few different approaches such as the one below, but I can’t get anything to actually happen on screen. I guess that I’m not applying the forces correctly.

```

var vibration_intensity = 1.0
var vibration_frequency = 0.1

func _physics_process(delta):
if randi() % int(1.0 / vibration_frequency) == 0:
var random_force = Vector3(
randf_range(-vibration_intensity, vibration_intensity),
randf_range(-vibration_intensity, vibration_intensity),
0
)
apply_impulse(Vector3(), random_force)

In the documentation for the apply_impulse() function, it says

“An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the “_force” functions otherwise).”

try apply_force() or apply_torque() instead

Thanks, it’s not quite working still, but I’ll communicate the power of my engine some other way.