set_pos() vs set_offset, pros and cons

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By LightBWK
:warning: Old Version Published before Godot 3 was released.

What are the pros and cons of using set_pos() compared to set_offset()?

:bust_in_silhouette: Reply From: Vladislav Vorobiev

set_pos() changes position of Node, set_offset() is defined for several nodes only and has its own result. Let’s read some documentation:

Sprite Node: set_offset(Vector2 offset)
Set the sprite draw offset, useful for setting rotation pivots.

Camera2D Node: set_offset(Vector2 offset)
Set the scroll offset. Useful for looking around or camera shake animations.

PathFollow2D Node: set_offset(float offset)
Sets the distance from the first vertex, measured in pixels along the path. This sets this node’s position to a point within the path.