diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs index 2760042..510e589 100644 --- a/Raylib-cs/types/Raylib.Utils.cs +++ b/Raylib-cs/types/Raylib.Utils.cs @@ -425,8 +425,10 @@ public static unsafe partial class Raylib public static CBool CheckCollisionPointPoly(Vector2 point, Vector2[] points) { - var pointsPtr = (Vector2*)Unsafe.AsPointer(ref MemoryMarshal.GetArrayDataReference(points)); - return CheckCollisionPointPoly(point, pointsPtr, points.Length); + fixed (Vector2* pointsPtr = &MemoryMarshal.GetArrayDataReference(points)) + { + return CheckCollisionPointPoly(point, pointsPtr, points.Length); + } } /// Generate image: grayscale image from text data