#headbob and armory bob variables const BOB_FREQ: float = 1.2 const BOB_AMP: float = 0.05 var t_bob: float = 0.0 if velocity.length() > 0: if is_on_floor(): t_bob += delta * velocity.length() * headbob_multiplier camera.transform.origin = _headbob(t_bob) func _headbob(time: float) -> Vector3: var pos: Vector3 = Vector3.ZERO pos.y = sin(time * BOB_FREQ) * BOB_AMP pos.x = cos(time * BOB_FREQ / 2) * BOB_AMP return pos
or share this direct link: