Player freezes after using clamp

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tomasantunes

I used clamp to set the transform.origin of the player and when he reaches the borders he freezes and I get this error:

at: RendererSceneCull::instance_set_transform (servers\rendering\renderer_scene_cull.cpp:761) ERROR: Condition "Math::is_inf(v.x)" is true.

Here is the code:

transform.origin.x = clamp(transform.origin.x, -15, 15)
transform.origin.y = clamp(transform.origin.y, -10, 10)

im not sure why, i try to using it in my sprite and try to moving it by adding position.x, and it works

nahcode | 2021-06-06 06:27