apply_central_force() pushes for one physics step only, so one call adds force × step time ÷ mass. In our Godot 4.7 test 300 N on a 0.45 kg ball gave 22.22 m/s at 30 physics ticks per second, 11.11 at 60, 5.56 at 120 and 2.78 at 240. For a kick use apply_central_impulse(direction * speed * mass): the ball gets exactly that speed at any tick rate.
The code
Put this script on the ball. Call kick() once, on the frame the foot or the club hits. For a charge shot, pass power from 0 to 1, for example how long the button was held divided by the full charge time.
extends RigidBody3D
## Ball that gets the same kick at any physics tick rate.
## Call kick(direction, power) once, on the frame the foot hits. power goes from 0 to 1 (charge shots).
@export var full_kick_speed := 25.0 # m/s added by a full-power kick
@export var lift := 0.15 # how much of the kick goes upward
func kick(direction: Vector3, power := 1.0) -> void:
var dir := Vector3(direction.x, 0.0, direction.z).normalized()
dir = (dir + Vector3.UP * lift).normalized()
var speed := full_kick_speed * clampf(power, 0.0, 1.0)
# An impulse changes the speed at once (speed change = impulse / mass).
# apply_central_force() only lasts one physics step, so its kick depends on the tick rate.
apply_central_impulse(dir * speed * mass)
What we measured
A real RigidBody3D ball, 0.45 kg, with gravity and damping turned off, at 30, 60, 120 and 240 physics ticks per second. Two runs with the same numbers.
apply_central_force(Vector3(300, 0, 0)), called once: 22.22, 11.11, 5.56 and 2.78 m/s. Ten steps later the speed was still the same, so the force only lasted one step.- The script at full power: 25.00 m/s at every tick rate. At half power: 12.50 m/s at every tick rate.
Why it happens
A force is per second. Godot applies one call for a single physics step, 1/60 of a second at 60 ticks, and then it is gone. Double the tick rate and the same call pushes for half as long. It is also why a kick made with a force feels weak: 300 N sounds like a lot, but 1/60 of a second of it only adds 11 m/s to a football. An impulse is the push already added up, so the speed changes by impulse divided by mass, whatever the step length. Keep apply_central_force() for pushes you repeat every physics frame, like wind or a current.
What to change
full_kick_speed: the speed in m/s a full-power kick adds.lift: how much of the kick goes upward. 0 keeps it on the ground.
Show where the ball will go before the kick: predict a ball trajectory line.
Ready-made ball game effects: Sports & Ball Game VFX for Godot 4 has 32 presets in Stylized and Retro PSX looks, including charge shots, kick impacts, ball trails, a Trajectory Preview and a goal net ripple.
Tested in Godot 4.7 with the Compatibility renderer.
Ready-made: Sports & Ball Game VFX for Godot 4 has 32 ready-made sports effects in Stylized and Retro PSX looks, including charge shots in 3 levels, kick impacts, ball trails and a goal net ripple.
More how-tos: Projectiles and aiming
- A ball that hits the net however hard it is kicked
- A shot that meets a moving target
- An Area3D that does not see a bullet or another area
- A fire rate that holds at any frame rate
- Point swords, projectiles and models that face +Z at the target
- FPS shots that land on the crosshair
- A spell that keeps flying straight after it leaves the hand
- Turn towards a target the short way round
- A laser beam that stops where it hits, the moment you aim
- Fast projectiles that never fly through enemies
- A trajectory line that matches where the ball lands
- Aim a spell at the mouse on a 3D floor
- A homing missile that turns, but not instantly
- Particles fall sideways when you rotate the emitter
- Particles that fly into the player
- Gaps in the trail of a fast emitter
- Make a tower shoot the enemy closest to your base
- Hit the target with an arcing shot at any angle and height
- Reload without losing or making up rounds
- Fan out any number of projectiles evenly around the aim direction
- Recoil that settles back to where the player aims