- Home /
Is there a way to move a target linked to a bone in a custom rig?
I have a character model and rigged it as follows..
I've rigged and skinned the body to a biped skeleton (in 3DS Max), skinned the head to the head bone, but added 2 additional custom bones for the eyes and linked them to the head so that they move together. Then I added a target object, consisting of 2 separate targets (splines) that are linked to the eyes with a LookAt Constraint. This way when I move the target I can move the eyes looking to that direction.. This way I can create my animations inside 3DS Max and export them to Unity through a .fbx file.
I'm wondering if I can do that directly from inside Unity. I'm working on a mobile game and it would really cool if I could transfer the same setup, along with the target objects and be able to move my eyes at will (for example I could touch the screen and make my character's eyes turn to that direction)..
Note: My eyes are not separate meshes. To save 2 draw calls I've attached them to the rest of the body and just skinned them to the 2 custom "eye-bones"
Answer by Cherno · Mar 08, 2015 at 12:54 PM
I see no problem getting this to work. You might have to use AddMixingTransform to ensure the eye bones are not affected by the animation being played for the rest of the rig. Then, you just need to declare a target Vector3 for your eyes and use this to make the eyes rotate towards it. If you want to avoid a cross-eyed look for near target positions, you have modify the targeting system a bit so the eyes actually look slightly to the left and right of the target position.
Hmmm.. I haven't done anything like this before, so bare with me, I may just not understand what you're trying to tell me..
I've imported my .fbx file into Unity, I see all the bones in my rig, if I rotate my RightEye Rig I can see the eye bulb rotating. So I guess there is a manual way with Transform.Rotate to rotate my eyes to each direction. But this is not what I want.
I've set my rig inside 3DS $$anonymous$$ax, with additional target controls. For example like I said I've added targets and linked them with a LookAt constraint to the Eye Bones, so wherever I move the eye targets inside 3DS $$anonymous$$ax, I see the eyes looking at that direction.
I've also added some morphs for the face of my character, and created some I$$anonymous$$ Hierarchy with some target sliders, so that I can create facial animation for my character..
Something like this: https://www.youtube.com/watch?v=z6QzZxV6GJQ
When I export this to .fbx and import it into Unity, these controllers are lost. I can see a gameobject with the same name, but when I move it nothing happens. Am I doing something wrong? Or this is not possible at all?
Answer by FastKillteam1 · Oct 16, 2017 at 10:25 PM
Transform.lookat(target) have public GO and drag n drop target GO into the slot
Your answer
![](https://koobas.hobune.stream/wayback/20220613185447im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Max 2011 Cat Animation 5 Answers
Problem with bone scale whilst re-assigning bone animations 0 Answers
How can I export 3d model from unity3d file? 3 Answers
My animated book shows half a black page for some reason. What is going on? 0 Answers
Which is the best/most efficient method of rigging in 3DS Max to use in Unity? 1 Answer