class_name PhysicsInterpolator extends Node3D

@export var physicsObject : PhysicsBody3D

var physics_delta : float = 1

var target : Transform3D
var prev : Transform3D

func _ready():
	target = physicsObject.global_transform
	prev = physicsObject.global_transform

var d = 0
func _process(delta):
	d += delta

	var t = d / physics_delta

	global_transform = prev.interpolate_with(target, t)

func _physics_process(delta):
	physics_delta = delta
	d = 0

	global_transform = target
	prev = target
	target = physicsObject.global_transform
