hurrmmm/godot/physics/billiard.gd

11 lines
231 B
GDScript

extends RigidBody3D
class_name Billiard
@export var power_min := 0.01
@export var power_max := 5.0
var can_hit = true
func hit(impulse: Vector3, power: float):
apply_central_impulse(impulse * lerp(power_min, power_max, power))