M
MadPropz101

  • 10 mar
  • Si è iscritto 2 mar 2018
  • @Harald I see, but would it be bad performance wise to use URP 3D for a 2D project?
    I converted my project to URP 3D, but now the colors on my Spine character look washed out. When I place the 3D lights into the scene they don't affect anything, neither my sprite objects or Spine objects. Which materials do I need to use? Will the shadows cast onto the surface behind based on the Z world position of the surface and the strength of the light? Do I need to have a light parented to each dynamic game object in order to cast the shadow behind them, or can I have just one global light for the shadows?

    • Harald ha risposto a questo messaggio
    • This is a standard Ai answer that doesn't help. Using those materials makes the character invisible on top of the shadows not working. Also, I cannot adjust the shape of the shadow in ShadowCaster2D manually, it needs to be set automatically by respecting the silhouette of the animation.

    • Hi,

      I am creating a 2D game in Unity and have set up URP. I want to cast a dynamic shadow from all the objects in my "default" layer onto the layer behind, lets call it "middleground".

      In Guacamelee 2 this sort of effect is done, a nice dynamic soft shadow is cast from the characters onto the background. As far as I am aware this game uses Spine for its animations.

      I am not very knowledgeable about the nitty gritty of rendering, but I assumed an effect like this would be simpler to achieve. I have been banging my head against the wall for days now trying to find a solution online as well as asking chatgpt just to get overly complicated solutions using custom shaders etc.

      Currently from what I understand I need a "ShadowCaster2D" on the object that I want to cast shadows, I can set Target Sorting Layer on this component in order to specify the "middleground", and then when I put a spot light 2D into the scene it should cast shadows of that object on the middleground.

      The issue with this it that it only works for Sprites and objects with Sprite Renderer, when I put it on my Spine character (which uses Mesh Renderer) the shadow cast is acting like a rectangle and there are also weird shadows appearing over the character itself, the mesh and animations silhouette are not being respected.

      The lights are also at an angle and which makes everything look like an isometric perspective even though I am making a 2D sidescroller, no matter how I rotate or move the light I don't know how to make it right. I don't need many point lights, I want one global light that makes the shadows.

      Also, placing a light in my scene affects the overall lighting and makes an area of the screen dark, I don't want this. I just want shadows without any lights, same as Guacamelee 2.

      I have been banging my head for days now trying to find a solution, and also asking chatgpt which keeps giving me overly complicated solutions using shaders etc.

      Can someone please help me out, I just need step by step instructions on how to make this work.

      • Harald ha risposto a questo messaggio
      • I'm using the Unity Animation Timeline in order to make a 2D video/cutscene using my Spine characters, but I don't know how to use Animation Tracks in order to blend two different animations?

        I have added two different "Spine Animation State Tracks" to the timeline, and placed each animation in a different track. However, when the timeline starts playing, only one animation is shown instead of having them blend into one animation.

        Edit: The issue was that I didn't have the Track Index set properly. In the Animation Timeline you click on the track on the left side, and then in the Inspector you change the Index number. I'm leaving this for someone in the future who might have the same issue.

      • Misaki ha scritto

        Hello,
        I totally know what you mean! It happens a lot.
        In that case, I usually duplicate the original mesh and move it to a new slot, and delete some vertices on the mesh’s hull, then put it above or below the slot that I want to sandwich.
        Mesh attachments can be shaved the outline by modifying the hull, so it allows separating an image in the Spine editor.
        The good point of this method is that it allows you to use a mesh that has exactly the same weight. Clipping masks can use weight, but it is tedious to match the vertices and weight with the original mesh.
        Also, even if you duplicate a mesh that uses the same image and place multiple meshes in the skeleton, that image will not be duplicated in the output atlas image, so it will not needlessly increase the size of the atlas.

        In your case, it would be better to duplicate the mesh of that backpack and put one above the legs and put one under the buttocks, or duplicate the buttocks mesh and cut out the buttocks mesh just for the part of the backpack that needs to be hidden, and put it above the backpack.
        If it penetrated between other mesh when you animated them, create a new bone for adjusting it and modify the outline.

        I hope this helps you.

        Hey, that's actually very smart! Thanks for the help :grinteeth:

      • I have this character that is wearing a backpack. The backpack is supposed to be resting on the upper buttocks. In order to get a proper bend, the legs and buttocks are not separate images and are instead a part of the same mesh.

        The issue is that the backpack has to be drawn on top of the legs, but behind the buttocks. I wanted to use a clipping mask around the butt, but I don't know how to match the deform of the clipping mask to that of the legs mesh, so that it always follows the contour of the buttocks properly. Binding the clipping mask to the same bones as the mesh doesn't work of course.

        I would greatly appreciate some help, thanks!

      • Erika ha scritto

        Hello,

        The trick is to parent the structure to a main bone, and duplicate that bone, then recreate the constraints which cannot be duplicated (this feature is planned but not available at present).

        please look at this video for a reference:
        https://www.youtube.com/watch?v=67Lk-EZbNG4&list=PLwGl7Ikd_6GTpd2PnWqqIZVsqotxtrtaE&t=910s

        Awesome, thanks for the video, the flipping idea for getting the transform is genius! The only thing I had to do manually was add the IK again and rebind the bones for the path and mesh.

        Regarding the mesh creation, can you explain what is the difference between those yellow/orange wires you get when holding the mouse click between two vertices, compared to the normal white/gray wires?

      • I have a Character Arm that I set up with a chain of bones constrained by a path, which is controlled by an IK, similar to this video:

        https://www.youtube.com/watch?v=BVH1Xvg9uvA

        It took me some time to set up the mesh vertices and everything so that the Arm would move smoothly, but now I would like to duplicate this to be used as the other Arm as well (since they are identical, just flipped). I tried duplicating everything but for some reason it doesn't work. I select all the bones, the IK, image for the Arm and the Path, but when I duplicate it all gets messed up and it's hard to make sense of it.

        Is there a convenient way to do this, or do I have to make everything again for the other Arm? Thanks!

      • Nate ha scritto

        Are the upper bones children of the lower bones? If so, when you move the lower bones, the upper bones will also move.

        Can you post or email a project that shows the problem you are having? If a bone has no weights (0%) for a vertex, it should not affect that vertex at all.

        Erika ha scritto

        This may also be caused by the triangle structure that connects the vertices. The best course of action would be to separate the upper and lower beak like in the owl example project: Owl example

        Seeing the mesh structure with weights, either as a screenshot or as the project, would definitely be useful.

        I looked into it again and it was indeed an issue with the structure. I have modified some vertices and now it works fine. Thank you for your help, and for the example project!

      • For example, let's say that for some reason a character has a body part like a bird beak/mouth that is only one image, and I want to move the upper or lower part independently using a mesh.

        I split up the upper and lower half of the mouth with the appropriate vertices, and using weights I assign them to the appropriate bones. For some reason, even though the lower bones have 0% weight effect on the upper mesh vertices, they still affect them, and thus the desired effect can't be achieved. Is there a reason for this, or something I'm missing? I would love an example if possible.

        Thank you!

      • I am having issues when trying to import my Spine project to Unity. I have tried with the example Spineboy project and I have the same issue. When I go to export, I set Texture atlas to Pack, and I tried both the "Attachements" or "Image Folder" option. The problem is when I import my .json to Unity I get the error that I have missing Atlas and that the SkeletonDataAsset has missing regions.
        Basically, my generated Atlas file seems to not be readable. How would I go about fixing this? I did some searching but the solutions like renaming atlas file to atlas.txt didn't help.


        Turns out I had to pack using the "Attachments" option, change atlas extension to .txt, and then manually drag atlas, .json and .png to Unity. Probably dumb of me but I don't remember having to do this stuff before.

      • I just came back to Spine after a while and as far as I remember there was a way to add an image (socket) to a bone by clicking shift on it and then creating the bone, but now when I try that it doesn't work? Has the shortcut been changed, what should I do?