Hi, trying to make interiors (caves, rooms etc) with the Sprite Shape tool. Please let me know if this is already possible, trying to find a good solution for over a year now. If this feature isn’t available then I strongly need it. See picture below.
Hi, If you are using version 7.x and lesser, please see a quick demo on how this can be achieved using the Confirming Spline example with some modification to the Script. Enclosed is a quick demo and the required ConformingInvertedSpline.cs to achieve the desired result. From version 9.0 onwards SpriteShape package provides ability to generate custom geometry/shapes by completely replacing or adding on to the default SpriteShape generator script. We will be adding more samples for this version soon. Will post an update.
Hi, thank you for the script! I followed the video but had some issues: For some reason my shape doesn’t align in the middle (like in your video). But increasing the “Outer Bound Size” in the ConformingInvertedSpline.cs script makes it less noticeable. (See first picture below) Biggest issue: Adding a Polygon Collider 2D to the “Bottom” child creates a nice Collider shape, almost how I want it. But there is no way to offset/expand the shape? (Dragging the “Offset” slider in the Sprite Shaper Controller doesn’t work). I want the the Collider shape to expanded so it reaches the “Top” parents silhouette. So the player walks on the ground. Adding a Polygon Collider 2D to the “Top” layer creates a shape that fills the room, which is no good, but offsetting works. (See second picture below) So close now, very happy to finally see this!
I believe the simple demo was done with object at origin (0,0,0) .. Will take a look. Offset usually is meant to resolve such issues actually. However you can also try Legacy/Geometry collider located in SpriteShape Extras.
If I center the pivot, everything is finally in the middle... For anyone wondering I got a script from a previous post, don't remember the guy, but he made a script that centers the transform of the Sprite Shape. Tried every setting / combination in the Legacy Collider on the "Bottom" game object, with no good results. The "Geometry collider" unfortunately doesn't have an offset setting. Kind of found something that's in the right direction, but it's still no solution: If I increase the offset in "Simple 2" (Sprite Shape), which belongs to the "Bottom" game object, I can expand the borders, to even go past the Top borders. Unfortunately the PolygonCollider2D doesn't follow the offset-shape, it stays at the position before the offset was applied. I think a lot of us "Sprite Shape users" would be so happy to see and update, for this. Something that's holding my team back from doing a whole game with Sprite Shapes is the lack of "interior shapes".
Thanks this works fine! just wondering how can this be achieved in 9.0 and onwards packages? Also, I am getting this exception when using the method shown in the video: Code (CSharp): Fill tessellation (C# Job) encountered errors. Please disable it to use default tessellation for fill geometry. UnityEngine.U2D.SpriteShapeController:LateUpdate () (at ./Library/PackageCache/com.unity.2d.spriteshape@9.0.1/Runtime/SpriteShapeController.cs:562) Disabling fill tessellation fails to make it work, so can't disable it **edit** I am getting the same issue as above poster
There cannot be any overlaps or intersecting edges in the given spriteshape. If the problem still persist, could you please post a sample scene or file a bug report ? Will take a look.