#Transform nested clothing not working

1 messages · Page 1 of 1 (latest)

quartz orbit
#

What you see is the inside of our character, the weird lines should have been clothes.
I can't really figure out why it doesnt work :)

    public void Align(Transform newParent, Transform asset)
    {

        for(int i = 0; i < newParent.childCount; i++)
        {
            foreach(Transform bone in asset)
            {
                if(bone.gameObject.name == newParent.GetChild(i).name)
                {
                    Debug.Log("Found a pair!");
                    bone.SetParent(newParent.GetChild(i), true);
                    bone.transform.position = newParent.GetChild(i).transform.position;
                    bone.transform.rotation = newParent.GetChild(i).transform.rotation;
                    bone.transform.localScale = new Vector3(1.5f, 1.5f, 1.5f);
                    Align(newParent.GetChild(i), bone);
                }
            }
        }
    }

        AlignClothMesh align = GetComponent<AlignClothMesh>();

        align.Align(player.transform, top.transform);
        align.Align(player.transform, pant.transform);
quartz orbit
#

@ocean wigeon ur Unity expert :D

ocean wigeon
#

Wait what?

quartz orbit
#

Wjat

ocean wigeon
#

Why am I being singled out here?

quartz orbit
#

How did I ping u soryr

#

@silk lynx

ocean wigeon
#

No worries man lol

quartz orbit
#

I'm sorry Shori lmfao

#

I swear it said Shork

#

Well have a nice day xD

ocean wigeon
#

Meh, mistakes happen lmao

silk lynx
quartz orbit
#

Read post ples 😳

#

I've been struggling with this for a week now

#

And I need this to work for the conference lmao

ocean wigeon
#

I might be mistaken here, BUT it looks like each point is being assigned to the exact same vector3 position.

silk lynx
#

Out of curiosity why are you setting scale to 1.5?

#

Why don't you just scale all your assets accordingly so everything can be 1?

quartz orbit
silk lynx
#

Ah

ocean wigeon
#

This. To try and work it out, instead of Hard Coding the scale value, would you not be able to make the scale vector3 a variable in the inspector to try and find a scale that works, and then hard code it?

silk lynx
#

Truth be told I'm not sure what I'm looking at in the picture

quartz orbit
#

Sorry

#

The picture is the inside of the character

silk lynx
#

Yeah it's just

#

Wonky image

quartz orbit
#

Those visible things are the clothes xD

#

It has to be, if I look at it directly shit disappears for some reason LOL

silk lynx
#

Is the outside of the character wrong? Or just the inside

quartz orbit
quartz orbit
ocean wigeon
silk lynx
#

So... non-issue?

quartz orbit
#

wdym?

silk lynx
#

Why do you care about what it looks like on the inside of the character?

quartz orbit
#

Because outside he's naked

silk lynx
quartz orbit
ocean wigeon
silk lynx
#

And he's supposed to have clothes?

#

Not be naked

quartz orbit
#

Yess

#

This is the clothes

#

And pants

silk lynx
#

Oh

#

Your rig hierarchy, is there any awkward scaling?

quartz orbit
#

Nope!

silk lynx
#

are you sure

quartz orbit
#

Fixed that 2 sprints ago lmao

#

Yess

ocean wigeon
#

Are the clothes their own objects, or part of the rig?

silk lynx
#

Because that looks like there's a parent with a weird scaling value, and you're forcing local scale to be 1.5, so it's honouring the scale for that awkward parent scale.

quartz orbit
#

But build the same like the rig is

#

So all the names fit

quartz orbit
#

Its the exact same

silk lynx
#

What happens if you add the clothing in the editor?

#

Cause the code looks fine. Albeit a little convoluted

quartz orbit
#

Hold

#

the

#

fphone

#

I will kill

#

My 3d artist

silk lynx
#

It's not the code is it?

quartz orbit
#

SOMEONE

#

Keeps enabling ocnvert units

silk lynx
#

there ya go

quartz orbit
#

I'm going to cry

#

Thank you

#

xD

silk lynx
#

happens to the best of us

quartz orbit
#

BOB IS NOW A CLOWN

#

LESGOO