I'm trying to create a script where, when a rigid body cube touches a podium, they are teleported to a set location. But I'm experiencing a weird problem. The script will seem to teleport the cube for a moment and then the cube will revert to its original location. Weirdly, this only seems to happen when using the enter_body signal.
So, in this example, I'm dropping the cube onto the trigger as shown in this example. (The script is attached to the Area node of the post. (Sorry for my bad diagram.)

func _ready():
var cube = get_node("../../Cube")
print(cube.translation)
cube.translation = Vector3(100, 100, 100)
print(cube.translation)
func _on_body_entered(body):
if body.name == "Cube":
print("body entered!")
print(body.translation)
body.translation = Vector3(100, 100, 100)
print(body.translation)
Terminal output:
(0, 19.3706, -10.0313)
(100, 100, 100)
When I run this code, the cube is immediately transported to (100, 100, 100) Seems fine. Now look what happens when I comment out the ready function as shown:
func _ready():
# var cube = get_node("../../Cube")
# print(cube.translation)
# cube.translation = Vector3(100, 100, 100)
# print(cube.translation)
pass
func _on_body_entered(body):
if body.name == "Cube":
print("body entered!")
print(body.translation)
body.translation = Vector3(100, 100, 100)
print(body.translation)
Terminal output:
body entered!
(0, 15.007609, -10.0313)
(100, 100, 100)
The print functions all get called and the second translate option, even displays the translation at the correct location, however, the cube doesn't move anywhere, and in the inspector, it still shows the translation to be the cube's original position. (Adding a breakpoint just after the translate shows the translation at all 100s in inspector but when you unpause the game the inspector shows the old location.)