How do I deactivate the script component that is in the chest of my humanoid model? I just want to deactivate this one dynamic bone that is inside of the chest with a OnClick funktion from my MainMenu object.But how do I write this in C# ?
Because I have several Dynamic Bones in the “Vroid Yuno…” model but I only want to disable that in the Chest when I run an OnClick event from the “MainMenu” object:
Hi,
So you have trouble writing that in C#? What you need is to make a reference o that specific bone in your script, and then make that button toggle it off.
So, to show the variable where you can drop an object reference you just make it public or use the [SerializeField] attribute.
Then make a public method, which will perform the disable operation, and make a reference to that method in that MainMenu OnClick.
This is easy to setup if your object is always in the same scene. But in case the character is not all the time in the scene , you need to find te component as you can’t have the reference in your MainMenu if the object is not in the scene.
How to write that?
I cant find a Video how this should work because i got more than one collider and dynamic bones.
But i have to enter it somehow like:
“YunoVroid…/Amature/hips/spine/chest/dynamic bone collider”…
But how to make this find this components like this path inside of a script?
Can you pleasr make me an example?
