• Daz 3D
  • Shop
  • 3D Software
    • Daz Studio Premier
    • Daz Studio
    • Install Manager
    • Partnerships
    • AI Training data
    • Exporters
    • Daz to Roblox
    • Daz to Maya
    • Daz to Blender
    • Daz to Unreal
    • Daz to Unity
    • Daz to 3ds Max
    • Daz to Cinema 4D
  • 3D Models
    • Genesis 9
    • Genesis 8.1
    • Free 3D Models
  • Community
    • Gallery
    • Forums
    • Blog
    • Press
    • Help
  • Memberships
    • Daz Premier
    • Daz Plus
    • Daz Base
    • Compare
  • Download Studio
ADVANCED SEARCH
  • Menu
  • Daz 3D
ADVANCED SEARCH
Add image
  • Shop
  • 3d Software
    • Daz Studio Premier
    • Daz Studio
    • Install Manager
    • Partnerships
    • AI Training data
    • Exporters
    • Daz to Roblox
    • Daz to Maya
    • Daz to Blender
    • Daz to Unreal
    • Daz to Unity
    • Daz to 3ds Max
    • Daz to Cinema 4D
  • 3D Models
    • Genesis 9
    • Genesis 8.1
    • Free 3D Models
  • Community
    • Our Community
    • Gallery
    • Forums
    • Blog
    • Press
    • Help
  • Memberships
    • Daz Premier
    • Daz Plus
    • Daz Base
    • Compare

Notifications

You currently have no notifications.

Loading...
    • Categories
    • Recent Discussions
Daz 3D Forums > 3rd Party Software > Unity Discussion

Why isn't my Script to Conforming/Attaching DAZ Clothng at runtime working?

nokoteb99nokoteb99 Posts: 931
July 2021 in Unity Discussion

Hello guys good evening thanks for all the help as always,

I'm making my preparations for my a game and one of them is learning how to attatch/conform/fit cltohes in Unity because by defautl clothes do not work well in animations, the body poke though and legs pop out of the lcothing like skirts and pants and ddresses. But i discovered a tutorial where  through a script, they make the c lothes bend with the body and kind of work the way Conforming clothes would in Daz studio. IN the tutorial i saw, which was made in like 2014 or 2015 it worked rpretty well and it was great, but its the first time i'm trtying it out...but guess what? Yesterday i kind of searcht the web for a more modern tutorial of doing the same thing and I found!!! i found another script posted by a Unity 2taff that does the same thing. And so i gave it a try and unfortunately it didn't work. And it might be total my fault because i'm known to be not too bright so i dont' know if it's my fault or if  the script jsut doesn't work in Unity 20201.1.5(version i use now).

 

Can anyone check this script and tell me why it wouldn't work and if i'm doing something wrong. Basically i'm adding ito the cloth item like the pants, i've trieed adding ito the top most parent of the clothes, then to the  object below that, and then tried even to the .Shape objetct of the cloth and it didn't work, for the target source i inputted the G8male.Shape . here's the script

 

    using System.Collections.Generic;    using UnityEngine;         public class Equipmentizer : MonoBehaviour    {        public SkinnedMeshRenderer TargetMeshRenderer;             void Start()        {            Dictionary<string, Transform> boneMap = new Dictionary<string, Transform>();            foreach (Transform bone in TargetMeshRenderer.bones)                boneMap[bone.gameObject.name] = bone;                      SkinnedMeshRenderer myRenderer = gameObject.GetComponent<SkinnedMeshRenderer>();                 Transform[] newBones = new Transform[myRenderer.bones.Length];            for (int i = 0; i < myRenderer.bones.Length; ++i)            {                GameObject bone = myRenderer.bones[i].gameObject;                if (!boneMap.TryGetValue(bone.name, out newBones[i]))                {                    Debug.Log("Unable to map bone \"" + bone.name + "\" to target skeleton.");                    break;                }            }            myRenderer.bones = newBones;             }    }

 

Sign In or Register to comment.
Adding to Cart…

Daz 3D is part of Tafi

Connect

DAZ Productions, Inc.
7533 S Center View Ct #4664
West Jordan, UT 84084

HELP

Contact Us

Tutorials

Help Center

Sell Your 3D Content

Affiliate Program

Documentation Center

Open Source

Consent Preferences

JOIN DAZ

Memberships

Blog

About Us

Press

Careers

Bridges

Community

In the Studio

Gallery

Forum

DAZ STORE

Shop

Freebies

Published Artists

Licensing Agreement | Terms of Service | Privacy Policy | EULA

© 2025 Daz Productions Inc. All Rights Reserved.