Skip to content

Commit f044c7c

Browse files
committed
Fix C# example about interpolating with quaternions
The `GetQuaternion` method was unexposed in 4.0. The example now uses the `Quaternion(Basis)` constructor which matches the GDScript example.
1 parent 2ec67eb commit f044c7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorials/3d/using_transforms.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ Converting a rotation to quaternion is straightforward.
383383
.. code-tab:: csharp
384384

385385
// Convert basis to quaternion, keep in mind scale is lost
386-
var a = transform.Basis.GetQuaternion();
387-
var b = transform2.Basis.GetQuaternion();
386+
var a = new Quaternion(transform.Basis);
387+
var b = new Quaternion(transform2.Basis);
388388
// Interpolate using spherical-linear interpolation (SLERP).
389389
var c = a.Slerp(b, 0.5f); // find halfway point between a and b
390390
// Apply back

0 commit comments

Comments
 (0)