Skip to content

Commit 4f1dbbc

Browse files
authored
Merge pull request #9429 from AThousandShips/translated_fix
Fix mixup between `translated` and `translated_local`
2 parents 1c485f9 + afb22f1 commit 4f1dbbc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tutorials/math/matrices_and_transforms.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,12 @@ to set its ``origin`` vector to (1, 2):
222222

223223
.. image:: img/matrices_and_transforms/translate.png
224224

225-
There is also a ``translated()`` method, which performs a different
226-
operation to adding or changing ``origin`` directly. The ``translated()``
225+
There is also a ``translated_local()`` method, which performs a different
226+
operation to adding or changing ``origin`` directly. The ``translated_local()``
227227
method will translate the object *relative to its own rotation*.
228228
For example, an object rotated 90 degrees clockwise will move to
229-
the right when ``translated()`` with ``Vector2.UP``.
229+
the right when ``translated_local()`` with ``Vector2.UP``. To translate
230+
*relative to the global/parent frame* use ``translated()`` instead.
230231

231232
.. note:: Godot's 2D uses coordinates based on pixels, so in actual
232233
projects you will want to translate by hundreds of units.

0 commit comments

Comments
 (0)