Skip to content

Instantly share code, notes, and snippets.

@thatalextaylor
Created November 18, 2024 09:00
Show Gist options
  • Save thatalextaylor/b82ede78e005aaa34720a61ac0981118 to your computer and use it in GitHub Desktop.
Save thatalextaylor/b82ede78e005aaa34720a61ac0981118 to your computer and use it in GitHub Desktop.
Higher resolution Sprite Shapes than unity allows in the normal editor. Cranking it too high can lead to tesselation errors. If there are errors, turn it down a little.
using UnityEngine;
using UnityEngine.U2D;
[DisallowMultipleComponent]
public class HighResSpline : MonoBehaviour
{
[Range(4,128)]
public int resolution = 16;
void Start()
{
var controller = GetComponent<SpriteShapeController>();
controller.splineDetail = resolution;
controller.colliderDetail = resolution;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment