Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity Tell us about your experience with Sprite Shape

Discussion in '2D' started by rustum, May 29, 2019.

  1. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    110
    Hiya folks!

    Sprite Shape.png

    The Sprite Shape package is being prepared so that it can be used in production. We'd like to get a better understanding of where it stands and how it's being used.

    Here are some questions to get this discussion started:
    1. Are you using Sprite Shape?
    2. If so, how are you using it? What can you tell us about the project you are using it in?
    3. Which parts of the tool and asset workflow feel smooth and which parts can be improved?
    4. Does the collider generation satisfy your project's needs?
    5. What improvements would you like to see for Sprite Shape collider generation?
    6. Do the Sprite Shape corner workflows satisfy your project's needs?
    7. What improvements would you like to see for making corners in Sprite Shape?
    8. Are you aware of the samples and extras that are embedded with the package? Are they useful?
    9. What other samples would be useful?
    10. Overall, what additional functionality would you like to see in the future?
    If you would rather answer these questions in private, please follow this link to answer a short survey.
    https://forms.gle/FmktDGHHnYyNsZkS7

    We can't wait to hear all your perspectives!
     
  2. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    105

    1+2.
    Yes. I'm making a fast-paced 2D platformer with curvy terrain like Sonic and am using it for nonterrain foreground decorations and certain terrain objects.

    3. The tool is very nice and smooth for the options it currently has available, but a lot of improvements can still be made, such as:

    a. Modifier keys when clicking on spriteshape tool hotspots (such as a shapepoint) to streamline certain modification features without having to disrupt eye+mouse position by needing to use the inspector UI. You could say it's minor, but coming from Ferr2D which has those types of features it is something I noticed as being a workflow disruption.

    b. Curve generation is currently just a manually shaped bezier curve. Since my game relies heavily on making perfectly precise angled straight and curved edges, a modifier-key+click on a tangent-mirror shapepoint that automates different types of precise uniform curve shapes would be ideal (one example curve-type being a perfect halfpipe curve like Sonic). Ferr2D currently can do this with a single click of a shapepoint which is one of the reasons why I still use it over SpriteShape for terrain objects. It doesn't need to be that fancy, but I can't really use SpriteShape for terrain with any curvature (which is most of my terrain) unless I can make perfect curves with it, which can't be done with just the current system.

    c. Separate material for edges for shader effects that don't affect the fill

    4+5. Collider generation has been immensely improved in the past couple months, but there are still a few quirks. There's still a weird bug with the offset=0 matching the fill shape less accurately than offset=0.00001. And I think the collider complexity can be optimized a bit more even still while still perfectly matching the fill mesh shape. Ferr2D can still generate a somewhat significantly simpler polygoncollider for an equally complex mesh shape.

    6+7. Corners are probably the worst feature at the moment. I think it would be a lot better if there were an option for Straight-line mode to automatically generate a corner for the point by very sharply bending the selected edge mesh. Very similar to how mirrored-tangent mode essentially generates a curved corner already, except just make it sharper. This creates a much smoother corner transition than needing to use a separate sprite. Specifically for shapes that represent natural landscapes like rocks, grassy cliffs, etc, which I'd argue are more prevalent than shapes that represent a more manufactured terrain that would benefit more from a custom corner sprite, like that of a building. Ferr2D manages to do it this way and it looks great.

    The current corners also break easily unless they're in a very limited shape range. The above suggestion would allow the corner to work at any extreme shape range.

    10. I have no idea how feasible any of the following will be in terms of even being possible to do, but:

    a. I'd love if there were some built-in edge transition features. For example I primarily use spriteshape for making natural scenery like cliffs, and in order for the edges to seamlessly blend with the fill in a professional-looking way, you need to feather the bottom half of the edge sprite in your preferred image editor so it blends into into the fill texture. Otherwise there's a clear and jarring visual difference where an edge meets the fill. I'm happy to do this manually in the image editor, but I'm using it just as a simple example of potential edge mesh transition features that can turn a shape from looking amateurish to looking AAA.

    b. Similar as the above, but for neighboring edges. If there were a built-in way to blend different edge textures together when they meet by internally overlapping and feathering them near the transition point, that'd be honestly amazing. This one's not technically possible to do through image editor tricks, so I highly doubt the effort/result ratio is worth doing on your guys' end. But I wanted to mention it anyway.

    c. I use an orthographic camera which means I need to manually move the transforms of background objects in order to create a parallaxing effect. But I also need it so the moving spriteshapes are synced to world-space UVs. The problem is at runtime if you attempt to move a spriteshape with world-space UVs enabled, the fill texture doesn't move with the object. So I essentially just need an option to have the spriteshape fill UVs set and saved to world space once and then have it stop syncing so it moves with the object properly.

    d. Maybe an option to pre-generate the mesh data and store it in the scene asset before runtime so a spriteshape doesn't use a decent amount of resources when it's first rendered.


    I think this is almost everything for my particular needs. I still use the tool for a bunch of stuff because it truly is great!

    Thanks for making it because it really makes certain types of games seem a lot more accessible for newer devs, which is always a good thing.
     
    Last edited: Jun 27, 2019
  3. Dabelnedy

    Dabelnedy

    Joined:
    Apr 2, 2017
    Posts:
    2
    1. I stay up to date and look at the updates but it's not a good idea for me to use it in my project yet due to a lack of features.
    2. I would use it for an action platfomer game, for all the walkable terrains.
    3. +6) The interface is really simple, so it's nice to use. But some key features like moving multiple points or changing multiple corner types at the same time are not available.
    4. I am satisfied with the collider generation, it does the job and is predictable. However, something changed in version 2.0 (unlike in v1.0) where an open-ended sprite shape's polygon collider no longer follows the path and is acting like it was not open-ended. There's also that bug where an offset of 0 creates two points at the same spot with the PolygonCollider.
    Proper collider generation (v1.0) on open-ended paths, collider follows the path correctly:
    Unity_2019-06-08_01-04-38.jpg

    Collider generation (v2.0) on open-ended paths, collider behaves as if it wasn't open-ended and tries to close the shape despite having an offset > 0:
    Unity_2019-06-08_01-04-17.jpg

    The samples are fine, there's no need for more.


    10. Making the tool be as fast as possible for use: moving multiple points, changing multiple corner points at the same time, adding hotkeys to the Shortcut Manager (like delete point on another hotkey, the Delete key is far away) and making the colliders be as simple as possible, I really want to use SpriteShape for my game because its collider generation doesn't create multiple convoluted forms unlike Ferr2D. That's an amazing thing for my custom pathfinding. So please don't go towards the Ferr2D collider generation and keep it like you started! I think it's possible I can use it soon for my project. Thanks for the hard work.
     
    FeastSC2 likes this.
  4. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    105
    It is currently possible to move multiple points and change their corner types at the same time by holding shift and clickdragging multiple points. Make sure to continue holding shift when moving a point with multiple points selected and it will move all of them. Also with multiple selected you can change corner type and it will change all selected points.
     
    Dabelnedy likes this.
  5. calRoto

    calRoto

    Joined:
    Feb 19, 2014
    Posts:
    4
    I love the SpriteShape tool and have been wanting this long before it was introduced. Currently I am using it for two purposes, unlike most common uses. First, it is being used on data obtained from a body tracking camera to create a shape in the silhouette of a person. In this case, the user's body is transformed into a topiary like bush with flowers. Second, I'm using the package for masking an oddly shaped projection screen.

    These two applications have led me to want two additional features for the package, one for each application. In the topiary example, it would be nice if the shape could use multiple random fill textures, instead of one titled texture. The tiled texture doesn't give enough variation in my example. Second, in the projection masking example, an on-screen in-game editor would be nice. The editor works really well and I wish I could use it during gameplay.
     
    CoCoNutti likes this.
  6. ameeruashour

    ameeruashour

    Joined:
    Jun 27, 2019
    Posts:
    3
    I'm currently having trouble finding the 2D Spriteshape tool. I have Unity 2019.2 Beta and I wanted to practice game development with the sprite shape. I tried to find it everywhere in the editor and the Unity Hub, but, I couldn't find it. Please help.
     
  7. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    @ameeruashour You can import SpriteShape package from PackageManager.

    Use the Unity Package Manager (in Unity's top menu: Window > Package Manager) to view which packages are available for installation or already installed in your Project.

    SpriteShape as of now is a Preview Package. Please enable the Preview Packages in Package Manager
    PackageManager -> Advanced -> Show preview packages.
    as shown in the attached screenshot :



    Current supported versions :
    2.1.0-preview.10 (2019.2 and above) versions
    2.0.0-preview.8 (2019.1)
    1.0.14-preview.2 for version 2018.4 and older.
     
  8. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    843
    I don't have much to add regarding the workflow and current feature set, but the one thing that is keeping our current project from adapting sprite shape is performance. Initially I looked into the preview package and liked it, but soon realized that even as a prototyping tool the performance is simply too slow and way too much gc allocations every frame to be usable on mobile and Nintendo Switch platforms.

    I know that performance optimizations are not to be expected by preview builds, but in this case it was so bad that it made me doubt that Sprite Shape will soon be ready for production, so we decided to not continue evaluating it. Please consider optimizing editor and runtime performance for the features it currently has.
     
    GliderGuy, steve-thud and Sandler like this.
  9. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    @Xarbrough Thanks for the feedback. We would like to understand more regarding performance issues you mentioned. SpriteShape geometry is mostly implemented in C# Jobs since 2019.1 (version 2.0.0-preview-4 and above) and should be much faster than 2018 preview versions (1.0.14-preview.2 and older)..

    We are continuously improving the feature and it would also be nice if you could send us a sample with more info on expectations. Thanks again.
     
    jc-drile77 likes this.
  10. jc-drile77

    jc-drile77

    Joined:
    Jul 1, 2014
    Posts:
    229
    We planned to use Ferr2D for our upcoming project. But as this is finally available (been waiting since 2015) as non-beta we will give it a try.
    Features and performance will increase with future updates, so using SpriteShape is the way to go for new or planned projects. And if I can recall correctly it is open source right?

    I will post another answer in a 5-6 months period which contains my (then) detailed experience using this.
     
    Venkify likes this.
  11. MrZzzero

    MrZzzero

    Joined:
    Dec 9, 2016
    Posts:
    59
    plz help i used the first version of sprite shape in my game and after updating unity i got some errors about sprite shape and i downloaded the latest version errors disappeared but everything ruined in my game levels, also when i tried the new sprite shape i found that there is 2 options open and closed not like the first version where u have 3 options when i do open sprite shape profile it gives me a closed shape is it a bug ? i mean i can't do the same as i did before with the one called strip from the first version, and how to fix my ruined levels sprites shapes ??
    image 1 : ruined strip sprite shape
    ruinedspriteshape.PNG

    images 2 : sprite shape option open

    openspriteshapeee.PNG

    result : as u see here the open one has 4 parts is it a bug or just need some configuration ?

    openspriteshape.PNG

    image 3 : sprite shape option close (looks like the old one , no problem with it)

    closedspriteshapeeee.PNG

    result :

    closedspriteshape.PNG
     
  12. MrZzzero

    MrZzzero

    Joined:
    Dec 9, 2016
    Posts:
    59
    plzz help it tooks from me like a month to finish my ruined levels its hard to redo all levels i used in them the oldest version of sprite shape
     
  13. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    843
    Back then I was concerned because SpriteShape was allocating GC every frame but in version preview.11 - 2.1.0 this allocation does not happen and the performance in general has improved. I think I will be incorporating SpriteShap into our current project and use it for optional environment assets. Once I've managed to test on our target platform, I'll report back if there are any issues, but it looks much more promising now. :)
     
  14. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    843
    I've tested a few more things and found a case that isn't working as nice as I had hoped it would:

    SpriteShape-vs-LineRenderer.PNG
    On the right is a LineRenderer with tiling texture (prototype palm tree). We would like to attach a bottom and top piece (caps), so I thought SpriteShape (on the left) would be the perfect fit. However, as you can see in the image, the texture is stretched sub-optimally for this specific use-case. In the following screenshot we can see the mesh that is generated:
    SpriteShape-vs-LineRenderer_Wireframe.PNG
    The LineRenderer mesh is very tight and therefore the stretching looks ok. The SpriteShape path has a much larger mesh because of the bottom piece which is much wider than the trunk. The wide mesh shows much stronger stretching.

    Would there be any way for SpriteShape to allow users to use separate sprites for the main piece and start and end caps? I would imagine some way of using the three pieces I currently have for the tree (roots, trunk and top cap) but use separate sprite meshes for them, so they can be tight on the trunk and reduce stretching.
     
  15. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    Thanks. Please do feel free to report any feedback/suggestions to the SpriteShape forum.

    Yes, you can use Variants to design such things. A simple demo :
     
    Xarbrough likes this.
  16. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    512
    Not used yet but after seeing all of the above, I'll be dropping 2D Toolkit from now on and using Unity 2d. Nice work, Unity.
     
  17. Pasketi

    Pasketi

    Joined:
    Sep 27, 2019
    Posts:
    3
    1. Yes, I downloaded it so I could use it in my own project
    2. I want to use it to create racing tracks and track environments. The track profile I'm creating using the edges of the shape tool with separate textures for
    3. The spline creation and editing are what you would expect from a path editor, all the way to node widths. Unfortunately, I don't have a proper way to assign the edge mesh as a collider. Using the edge collider doesn't take into account variable width (height) of the edge and mesh collider can only be applied to the fill of the shape
    4. Mostly yes, but I can notice some unwanted distortion in the inner side of the edge graphic on sharper corners
    5. I would like to be able to create colliders that fill the area of my edge mesh instead of the fill mesh. If possible, I would also like to separate the fill mesh and offset it to start on the edge of the edge mesh instead of the center of the path
    6. Mostly answered at #4
    7. N/A
    8. No, I'll need to check them out
    9. N/A
    10. !! I would like to be able to apply sprite slicing to the edge sprites to keep the edges of the sprites consistent throughout the mesh even with variable edge width !!
     
  18. kyuskoj

    kyuskoj

    Joined:
    Aug 28, 2013
    Posts:
    38
    When I change the height while Edit Spline mode, it doesn't consider my sprite's border.
    Is it intended?
     
  19. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,026
    SpriteShapeRenderer color doesn't work with LWRP 2D Lit/Unlit Material. At least in 2019.2 anyway.
    Trying to implement _RendererColor in a custom shader throws "Redefinition of _RendererColor" error.

    So my experience so far...
    Not great.
     
    Cambesa likes this.
  20. RistoPaasivirta

    RistoPaasivirta

    Joined:
    Aug 25, 2017
    Posts:
    3
    Great tool, but currently Tangents / Bitangents are not calculated properly.

    I want to use normal mapped material on the sprite shape and I see that at some angles the light hits the wrong side of the sprite. This is the only fix I need to be able to start using this awesome new technology.

    edit: I downloaded Unity 2019.3.0b6 (beta) and from there the Sprite Shape 3.0.5 package
    It has "enable tangents" option in the sprite shape controller. Turning that on seems to fix the issue.

    I am one happy champ \o/
     
    Last edited: Oct 8, 2019
    Venkify likes this.
  21. GigaRoid

    GigaRoid

    Joined:
    Oct 7, 2013
    Posts:
    35
    Not sure what's up, but the repeating sprite I have attached is shifting along the long axis when I place new points on it and remove points at runtime. I can't find a way around this bug at the moment. Currently on version 2019.2.
     
  22. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    @pastaluego Please check https://forum.unity.com/threads/spriteshape-3-0-6-is-out.771461/ . In version 3.0.6 we have added support for this.

    @Xarbrough We have further improved SpriteShape performance by adding support for Burst. Now most of the SpriteShape generation should be much faster now. To enable burst, all you need to do is to import Burst package.
     
  23. Srakso

    Srakso

    Joined:
    Sep 8, 2019
    Posts:
    1
    I was browsing through the available sprites I had to test out the package, and at one point got this error:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.U2D.SpriteShapeEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.2d.spriteshape@2.1.0-preview.11/Editor/SpriteShapeEditor.cs:305)
    3. UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:501)
    4. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    5.  
    I will take a look what kind of sprite exactly caused this
     
  24. Sicinsions

    Sicinsions

    Joined:
    Dec 18, 2019
    Posts:
    11
    I don't tend to use the Sprite Shape too often, still, I find that the workflow and current feature set, are perfectly fine. Thanks!
     
  25. guyunger

    guyunger

    Joined:
    Aug 9, 2013
    Posts:
    1
    One feature that I would really like to see is rounded corners. This is equivalent to creating 2 points at equal distances from a corner and aligning the bezier handle with the straight side. When I look at sprite shapes people make, the shapes often look a bit awkward, I think the bezier curves right now push you towards making these kinds of shapes.
    curves.jpg
     
  26. johannig

    johannig

    Joined:
    Apr 22, 2015
    Posts:
    23
    Are there any plans to fix the fact that you can't change colors of sprites if you're using LWRP?
     
  27. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    @guyunger
    Thanks for the feedback. With the current workflow we try to not add any additional points while editing the SpriteShape . (Because it would be quite tricky or impossible to get back to original spline). However it is possible to write scripts that modify the spline at run-time (or Editor time if its ok to do this lossy conversion) to get this desired behavior. We will post more samples for such scenario.
     
    GliderGuy and RemDust like this.
  28. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    Yes, we are aware of this issue and are fixing it. Will post an update as soon as it gets published.
     
  29. johannig

    johannig

    Joined:
    Apr 22, 2015
    Posts:
    23
    Perfect, good to know! Haven't come across any other issue and loving it so far.
     
  30. cubeactive

    cubeactive

    Joined:
    Feb 22, 2020
    Posts:
    1
    I'm trying to find out if I'm just doing something wrong or if this is a limitation of the sprite shape.
    I'm using an open sprite shape to create platforms. It has an edge collider 2D for the top of the platform. But I would also like to add an edge collider for the bottom of the platform. If I add a second edge collider to the object this is not being updated with shape of the platform.
    I Might be able to fix it with an custom script, but it would be nice for the open sprite shape to be able to do this by default.
     
  31. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    99
    I've tried using this in a 3d world on non static objects and it's causing extreme frame spikes every second or so. I have to convert the finished shapes to regular sprites.
     
  32. johannig

    johannig

    Joined:
    Apr 22, 2015
    Posts:
    23
    I've also encountered the problem, that when I use a texture as a filler the normal map does not work with it. Are you guys aware of this and will this be fixed?

    Edit:
    This actually does work when playing, but is not visible in scene view. However, it's very unstable and a lot of the time it will use the normal map of the edges rather than the filler.
     
    Last edited: Mar 6, 2020
  33. johannig

    johannig

    Joined:
    Apr 22, 2015
    Posts:
    23
    Actually just seems like a fluke that it actually worked once. Does this work at all for others?
     
  34. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    For such use-case, I would suggest using GeometryCollider available in the Extras. Check SpriteShape page in the PackageManager to install it.

    More info here : https://forum.unity.com/threads/spriteshape-preview-package.522575/page-6#post-4479055
     
  35. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    Could you please post a simple project to demonstrate the case ?
    Fill area uses Texture2D (as it requires repeat UV mode) and hence does not use Sprites (or secondary textures). You can set the NormalMap either through MaterialPropertyBlocks or directly in Material itself. Please let us know if this is what you are looking for.
     
    johannig likes this.
  36. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    SpriteShapes are generated only when there are change in Input parameters. And for most use-cases spriteshape geometry generation is reasonably fast with Burst enabled.
    Could you please post a sample or a repro project ? We will take a look asap.
     
  37. johannig

    johannig

    Joined:
    Apr 22, 2015
    Posts:
    23
    This worked. Thank you very much for the help!
     
  38. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    99
    No there's no way I can post a sample without the whole project. Is there something I can do here to get more info? It's hard to reproduce and sometimes not noticeable but disabling them creates a much smother curve in the GPU profiler.
     
  39. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    636
    Last edited: Mar 14, 2020
  40. soundscouts

    soundscouts

    Joined:
    Apr 6, 2016
    Posts:
    6
    Also unable to change the Shape Sprite Renderer color on anything that is not the Sprite_default material
    (Using SpriteShape 3.0.10, LWRP & 2DRenderer, Unity 2019.3.6)

    Specifically trying with Lit Sprites
     
  41. NotEvenTrying

    NotEvenTrying

    Joined:
    May 17, 2017
    Posts:
    25
    How is this still not fixed? Its been several months, and numerous patches/updates to the package, and one of the most basic and fundamental features being broken is still left unchecked? Especially since other 2D features the Unity team has been marketing with this, like 2D lights, are only available on the 2D renderer in the new SRP.
     
  42. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    This has been fixed in URP (2D Renderer) and will be available in the next version. Meanwhile you can give the fix a try by modifying the following locally (in package)

    1) In file com.unity.render-pipelines.universal/Shaders/2D/Include/CombinedShapeLightShared.hlsl

    // Add the following shader variable.
    half4 _RendererColor;

    // In function CombinedShapeLightShared, also include _RendererColor during color calculation.
    half4 CombinedShapeLightShared(half4 color, half4 mask, half2 lightingUV)
    {
    color = color * _RendererColor; // This is needed for sprite shape

    2) In file com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/SpriteUnlitPass.hlsl

    // Modify line 29 to take into account _RendererColor
    surfaceDescription.Color *= unpacked.color * _RendererColor;

    Make the changes, restart the Editor, make sure the above changes are still there and reimport the Sprite URP Shaders. This should fix the issue.

    Will post an update as soon as URP package with the above fixes is available.Sorry for the inconvenience caused.
     
    soundscouts and NotEvenTrying like this.
  43. Torbey

    Torbey

    Joined:
    Nov 13, 2015
    Posts:
    3
    Hey guys
    Maybe someone can help me. I'm stuck here. I'm using a simple SpriteShape profile with a edge texture and a fill texture. Everything works so far. But the edge texture disappears when I click on play. When I leave the play mode the texture is displayed again. Even i the game view the texture is visible.

    I thought this would be a good place to ask :)

    Does anybody have the same problem or can even help me? Been stuck on it the whole day

    How it looks in Gameview without playmode:


    How it looks in Gameview with playmode active:
     
  44. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    Hi, could you please post a simple repro project ? Will take a look asap.
     
  45. Torbey

    Torbey

    Joined:
    Nov 13, 2015
    Posts:
    3
    Hey Venkify,
    I just found the error. I had my camera z-position set to 0. Now that the z-position of the camera and the SpriteShape were at 0, I guess that was cut away. I could set the Near Clipping Plane from 0 to a negative value, but I don't know what negative consequences this could have. So I just gave the camera a z-offset. But I wonder why the fill texture was displayed anyway.

    Thanks for your support anyway!

    By the way, can I make a feature suggestion?
    Currently you can specify several textures for the different ranges. It would be quite handy if I could choose to automatically use random textures. Currently I can only select one texture for each point, which will be used up to the next point.

    Nevertheless all the best and have a nice day!
     
    RemDust likes this.
  46. shieldgenerator7

    shieldgenerator7

    Joined:
    Dec 20, 2015
    Posts:
    18
    First off, I want to say that I really like SpriteShape, even in its early versions. And I really appreciate how responsive its devs are, it really means a lot to me.

    That said, it is still rather tedious to use and I want to make some tools to make it even easier to use SpriteShape, but have hit a dead end.

    I want to make a leveling tool and allows me to set a certain selection of points of a SpriteShape terrain to all have the same Y value. The points may or may not be consecutive. I know how to get the position of any point in the spline, but I don't know how to get the list of selected points. How do you access which points are selected when editing a SpriteShapeController?
     
  47. IceTrooper

    IceTrooper

    Joined:
    Jul 19, 2015
    Posts:
    24
    Hi, is it possible to use Polygon Collider 2D (instead of Edge Collider 2D) in Open Ended SpriteShape platform?
    upload_2020-4-12_12-15-20.png
    In this case (simplified) I got simple platform without any curves, I just want to add Polygon Collider to cover the entire platform sprite not only the top edge of platform. It has to work with "Update Collider" from Sprite Shape of course, I don't want to adjust Polygon Collider every time I change my shape.

    In different words, I want to have updated collider like this (red edges) in Open Ended shape:
    upload_2020-4-12_12-22-26.png
    For now I got only blue edge collision :/

    How to achieve this? If it's not possible with open-ended shape, how to cheat that effect with closed shaped?


    EDIT: btw, why can't we use a single sprite from spritesheet (Sprite Mode: Multiple) in Fill Texture property? Why it has to be a separated .png file? Everywhere we can assing sprites from spritesheet, but not in that one single property. It's just strange.
     

    Attached Files:

    Last edited: Apr 12, 2020
  48. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    405
    Please take a look at Geometry Based Collider in this post :
    https://forum.unity.com/threads/spriteshape-preview-package.522575/page-6#post-4479055
    You can get it by importing the Extras package available through SpriteShape page from PackageManager window.

    Because we use Repeat UV for Wrap mode for the Fill texture to simplify Fill area and tessellation. With SpriteSheets or Atlases usage of Repeat UV is not possible. Hence only Fill texture is allowed. Thanks.
     
    IceTrooper likes this.
  49. daek_f

    daek_f

    Joined:
    Nov 7, 2018
    Posts:
    7
    Just tried that. As soon as I applied your changes, I could see the results immediately. However, when I restarted Unity, they defaulted back to the original code. Is there a way to prevent this? Unity 2019.3.9f1
     
  50. ryaanjpf

    ryaanjpf

    Joined:
    Feb 17, 2020
    Posts:
    12
    Hi,

    Why do corner sprites not generate even though there is still enough room for them? In code it looks like this could be due to SpriteShapeGenerator.cs in function AttachCorner it returns false here:

    if (ld < pxlWidth || rd < pxlWidth)
    return false;

    When perhaps it should instead be:

    float halfPxlWidth = pxlWidth * 0.5f;
    if (ld < halfPxlWidth || rd < halfPxlWidth)
    return false;

    This fixes it for me locally. But maybe it's only working now because I'm using center pivoted sprites. But it seems to make sense, with that code change it would then not render the corner if the space on one edge of the spline corner is less than the radius/halfextent of the corner sprite. Is this a bug?
     

    Attached Files:

unityunity