This commit is contained in:
MarkYabut committed 2026-10-06 19:44:18 -04:00
1 parent fb92181e53
commit 8768909429
9 files changed
+115 -60

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
class_name Crate extends RigidBody2D
var teleport_target: Vector2 = Vector2.ZERO
var should_teleport: bool = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func teleport_to(position: Vector2):
teleport_target = position
should_teleport = true
func _integrate_forces(state: PhysicsDirectBodyState2D) -> void:
if should_teleport:
state.transform = Transform2D.IDENTITY.translated(teleport_target)
should_teleport = false