- Home /
UnityEditor > Assign a Physics Material from asset folder to colliders component of objects
hi !
ok here is my little issue , for the game i am doing now , i have quite a bit of box collider to setup. I write a little script using the unity editor API that allow me to import box model from my 3d app and apply at once a box collider component / tag name etc..
But I am stuck for one things, I don't really know how i can assign my physics mat in the same way. The material reside in "GameProject / Physic Material" folder of my project.
I can actually success to create a physic material from scratch while I apply my editor command on my selected object, but it create a physics mat under scene so make things hard to edit later.
what command I should look into inside unity editor API ?
by the way I am using C#
thanks a lot ;)
Answer by KvanteTore · Mar 23, 2010 at 10:44 AM
You can use Resources.LoadAssetAtPath to get hold of an asset in a editor script.
Your answer
Follow this Question
Related Questions
Is there a way to mass assign materials? 4 Answers
Mipmap view not working in editor. 0 Answers
Changing physical material impossible? 1 Answer
Why does Unity 2019.1 constantly (re)import things? 0 Answers