You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to [method sample_baked], but returns [Transform2D] that includes a rotation along the curve, with [member Transform2D.origin] as the point position, [member Transform2D.x] as the sideways vector, and [member Transform2D.y] as the forward vector. Returns an empty transform if the length of the curve is [code]0[/code].
110
+
Similar to [method sample_baked], but returns [Transform2D] that includes a rotation along the curve, with [member Transform2D.origin] as the point position and the [member Transform2D.x] vector pointing in the direction of the path at that point. Returns an empty transform if the length of the curve is [code]0[/code].
111
111
[codeblock]
112
112
var baked = curve.sample_baked_with_rotation(offset)
113
-
# This will rotate and position the node with the up direction pointing along the curve.
113
+
# The returned Transform2D can be set directly.
114
+
transform = baked
115
+
# You can also read the origin and rotation separately from the returned Transform2D.
114
116
position = baked.get_origin()
115
117
rotation = baked.get_rotation()
116
-
# Alternatively, not preserving scale.
117
-
transform = baked * Transform2D.FLIP_Y
118
-
# To match the rotation of PathFollow2D, not preserving scale.
0 commit comments