Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question 2D/ Bone Weights / Vertex questions

Discussion in 'Animation' started by bluebamf1, Jun 2, 2022.

  1. bluebamf1

    bluebamf1

    Joined:
    Jun 2, 2022
    Posts:
    8
    Hello,

    I have 2 bones. Let's call them "Bone A" and a child, "Bone B".

    My question is is there a way to make Bone A and Bone B move opposite of each other having an effect on their associated vertexes?

    If I move Bone A 50 pixels on the the X affecting vertexes associated with Bone A, can I have Bone B move -50 pixels on X affecting vertexes associated with Bone B? So they can move opposite direction of each other?

    I've been scouring youtube and haven't had an luck with that type of scenario. Any help would be greatly appreciated. Thanks in advance!
     
  2. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    179
    Hi @bluebamf1, currently weights in the Skinning Editor can only be positive.

    I would like to better understand your use case, could you please describe the effect you are trying to achieve in more detail? A quick sketch or a video would be super helpful.
     
  3. bluebamf1

    bluebamf1

    Joined:
    Jun 2, 2022
    Posts:
    8
    Hello @MarekUnity ,

    First, thank you for your reply and interest. I am trying to do face rigs directly in Unity. I have sent a youtube video below. In the video, there are 3 types of rigs. Think of them this way:

    1st Rig: Simple
    2nd Rig: A bit more complex
    3rd Rig- Even more complex

    I have been able to emulate 1st Rig in Unity! But, I wanted to try to push the rigging in Unity and try to emulate Rig 2. I have the link with the timestamp(roughly 7 min mark) here:



    You'll notice that the artist is able to move Bone "A" one direction and Bone "B" is configured to move the other way.
     
    Last edited: Jun 8, 2022
  4. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    179
    Thank you @bluebamf1, I think I know what kind of effect you are trying to achieve. This is a known limitation of our system. The 2D Animation package comes with IK constraints for limbs and bone chains, but we don't have dedicated position constraints - I would like to know if such constraints would be useful for 2D animators working in Unity.

    Unity Editor comes with position constraints but they were designed for other use cases. In some simple scenarios you should be able to set the source influence to -1 to 'mirror' game object transforms.
    upload_2022-6-9_15-1-58.png
    However, you might face some issues when you shift your parent game object to a different position as demonstrated in this video:


    This is not the officially recommended way to solve this problem, but you could work around it and modify your Position Constraint sources to include:
    2 x Parent transform
    -1 x Source transform
    Screenshot 2022-06-09 at 3.43.50 PM.png

    Here is a video to illustrate this idea:


    Let me know if this solution works for you.

    Another way to create such rig would be to use the Animation Rigging package. It was designed with 3D character in mind, but if you have some experience with C# programming you could write your own custom constraint to work with Animation Rigging.

    Hope this helps.
     
    Last edited: Jun 10, 2022
  5. bluebamf1

    bluebamf1

    Joined:
    Jun 2, 2022
    Posts:
    8
    Thank you @MarekUnity I am rigging my characters within the Sprite Editor in Unity using bones, mesh, and weights. I don't see a way to set position bone constraints within that sub window/environment. It appears your suggestion is one level outside in the main Unity editor? I am a bit of a noob with Unity so perhaps I am misunderstanding.
     
  6. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    179
    That's correct, this is something that can be done outside the Skinning Editor - constraints are added to game objects as components. You could create an instance of your character by dragging and dropping it into your scene and add constraints to bone game objects.
     
  7. bluebamf1

    bluebamf1

    Joined:
    Jun 2, 2022
    Posts:
    8
    Sorry for the delayed response. Thank you for the suggestion. I will try to keep your suggestion in mind as I try to set up more characters.
     
    MarekUnity likes this.