How to instantaneously move a KinematicObject?

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

I’ve created a small scene that implements a camera that can follow my player around. It has a KinematicBody so it can collide with rigid bodies and not pass through them. It works pretty well, but there are some times when the camera gets into a bad spot (eg, it is too far away from my player) and I want to instantaneously jump it to somewhere close by.

How do I do this? The Kinematic body methods only seem to be for sliding in a linear direction. I’ve tried setting the position directly with global_transform.origin = targetPos, but that get me some weird behavior sometimes. (I suspect it is intersecting with the KinematicBody of my player and that is causing weird interactions).

:bust_in_silhouette: Reply From: ondesic

You can use it’s Translation property to move it instantly.