Topic: Character mirroring issue

I have a character with a sword and a shield that are part of the character mesh and they're skinned to bones that are a child of the hands. When the character is on the right side of the screen it mirrors his animations which would be great if he wasn't holding objects.

Is there a way to disable mirroring animations? Or does UFE have some other support for dealing with character props?

Share

Thumbs up Thumbs down

2 (edited by christougher 2016-05-30 00:31:55)

Re: Character mirroring issue

Yes. You can do that. But it's a global option, meaning it will apply to all your characters. I use characters with weapons in their hands but I do use mirroring and a workaround to enable the correct one based on orientation. UFE doesn't really have an out of the box option for props and weapons. Are the sword and shield separate skinned meshes or is it all one?  If they are separate and able to be disabled I can share my approach if you want.

Edit: here's a prior thread where we discussed some of these same issues
http://www.ufe3d.com/forum/viewtopic.php?id=586

Share

Thumbs up Thumbs down

3 (edited by chrisb3d 2016-05-30 00:40:20)

Re: Character mirroring issue

They're separate mesh objects skinned to the mount bones on the left and right hand of the character skeleton. I found the Character Rotation Options but I was surprised it used the animations facing and it wasn't controlled by the prefab.

Yeah, any help would be great.

Edit: I was hoping to avoid using mecanim because of the animated mount points I have on the hands. That animation info wont be mirrored over to the opposite hand mount. For example I rotate the sword mount point in the hand so I don't have to break the wrist in my attack poses.

Share

Thumbs up Thumbs down

4 (edited by christougher 2016-05-30 01:18:16)

Re: Character mirroring issue

So, to clarify, your animations animate the mount point itself right? which would indeed be a problem for mirroring. Unless you add a mount point with similar animation on the other side. In other words two mount points with swords and two with shields. For mine the weapons are simply a child of each hand and are visible based on direction faced. Each sword has two hit boxes to cover the length of it and I modded the code to mirror those hit boxes just like they were a left or right hand. I actually have three swords on my character at different points (sheathed, left hand, right hand) and dis/enable the mesh renderer when needed.

So, before I get too long winded what approach are you wanting to use mirrored or not?

Check out the showcase for Horde Combat which doesn't mirror and looks pretty good.

Share

Thumbs up Thumbs down

Re: Character mirroring issue

float standardZRotation;
public void InvertRotation(){
//        standardYRotation = -standardYRotation;
        //        abhishesh================
        standardZRotation = 180;
        character.transform.localScale = new Vector3 (-character.transform.localScale.x, -character.transform.localScale.y, -character.transform.localScale.z);


        //        ================
    }

    private void testCharacterRotation(float rotationSpeed){
        testCharacterRotation(rotationSpeed, false);
    }

    private void testCharacterRotation(float rotationSpeed, bool forceMirror){
        if ((mirror == -1 || forceMirror) && transform.position.x > opponent.transform.position.x) {
            mirror = 1;
            InvertRotation();
            if (UFE.config.characterRotationOptions.autoMirror) ForceMirror(true);
            //abhishesh==========
            character.transform.eulerAngles = new Vector3 (character.transform.eulerAngles.x, 90, character.transform.eulerAngles.z);
            //=================

        }else if ((mirror == 1 || forceMirror) && transform.position.x < opponent.transform.position.x) {
            mirror = -1;
            potentialBlock = false;
            InvertRotation();
            if (UFE.config.characterRotationOptions.autoMirror) ForceMirror(false);
            //        abhishesh================

            standardZRotation = 0;
            character.transform.localScale = new Vector3 (character.transform.localScale.x, character.transform.localScale.y, character.transform.localScale.z);

            //================
        }
//        character.transform.rotation = Quaternion.Slerp(character.transform.rotation, Quaternion.AngleAxis(standardYRotation, Vector3.up), Time.fixedDeltaTime * rotationSpeed);
        //        abhishesh================
        character.transform.rotation = Quaternion.Slerp(character.transform.rotation, Quaternion.AngleAxis(standardZRotation, Vector3.forward), Time.fixedDeltaTime * rotationSpeed);
        character.transform.eulerAngles = new Vector3 (character.transform.eulerAngles.x, 90, character.transform.eulerAngles.z);
        //================
    }
   
    private void fixCharacterRotation(){
        if (currentState == PossibleStates.Down) return;
//        if (character.transform.rotation != Quaternion.AngleAxis(standardYRotation, Vector3.up)){
//            character.transform.rotation = Quaternion.AngleAxis(standardYRotation, Vector3.up);
//        }
    }


replace above code in controlsScript.cs and uncheck autorotation from global editor window

Share

Thumbs up Thumbs down

Re: Character mirroring issue

Thanks for the replies.. Yeah, I'd like to avoid mirroring in this case and keep the animated mount point. I'm an animator so it would kill me to have to over rotate the hands to point the sword forward. With larger shields it may obscure the character a bit but I can deal with that in posing.

Awesome, abhishesh. I'll give that a shot too assuming it's as easy as copy and paste.

Share

Thumbs up Thumbs down

Re: Character mirroring issue

Sadly I only have UFE Pro and can't edit that file. Is there some other method?

Share

Thumbs up Thumbs down

Re: Character mirroring issue

So, in the global/character rotation options you have auto mirror off right?  What about in the individual move files under the animation section?  There are options to toggle mirror and/or rotate based on side.

Share

Thumbs up Thumbs down

Re: Character mirroring issue

Yeah, when I have auto mirror off the character on the right side of the screen is facing right. I was hoping there would be an option to not have the animations mirrored but have the character pointed the correct direction. I guess not without having access to the source.

Share

Thumbs up Thumbs down

10 (edited by christougher 2016-05-30 21:22:35)

Re: Character mirroring issue

Yes you can do that in the move/animation section. Check the box to rotate on the right side only I think is what you're looking for

Read here down at the Orientation about 2/3's down... http://www.ufe3d.com/doku.php/move:animation

Share

Thumbs up Thumbs down

Re: Character mirroring issue

That flips the character when the move is executed but there's no flipping the basic moves.. Idles, blocks, hits etc. That also wouldn't face the character at the opponent either. It just flips the animation regardless of where the opponent is.

Share

Thumbs up Thumbs down

Re: Character mirroring issue

So maybe what your best option is to have the global auto mirror on and the also check the mirror option for the right side in the move file. I very well could be wrong but I thought they cancelled each other out. Otherwise I'm fresh out of ideas.

Share

Thumbs up Thumbs down

Re: Character mirroring issue

http://www.ufe3d.com/forum/viewtopic.php?id=114

you can try above link also.

Share

Thumbs up Thumbs down

Re: Character mirroring issue

Sadly to animate the sword correctly and not have broken wrists I animate the sword mount point so it flexes in the characters hand and the fingers grip adjusts.


I can give the global mirror on and the check the flip in the animation a shot when I get home but I have a feeling it will mess up the other side when the same 2 characters are picked. It wouldn't fix the idles, blocks etc. being mirrored though.

I'm tempted to upgrade again to fix this but +$184 just to fix this mirroring issue seem rough. This is still an awesome tool though. There need to be more like it.

Share

Thumbs up Thumbs down

15 (edited by chrisb3d 2016-06-04 19:02:55)

Re: Character mirroring issue

So, I figured it out. It was about 5min after I had purchased the source upgrade but it's an awesome tool so I didn't mind I guess.

I noticed after I picked Legacy Mike as one of the characters. When he moves to the other side of the screen his rotation turns but he doesn't mirror when Auto Mirror is unchecked in the Global - Character Rotation Options. At first I thought it might be because of the legacy setup in the character rig but it's not.

When I was setting up the hit boxes on the character it has to be at Y: 90 rotation. I had mine at Y: 180 rotation because of the characters facing from MotionBuilder. After re-setting up the hit boxes with Y: 90 rotation on the character and rotating the animations in Mobu to face +Z everything seems to work and uses Mecanim.

Share

Thumbs up Thumbs down