- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
KingKongFu · Jan 15, 2013 at 04:01 PM ·
camera3dsmaxskeleton
Attach a camera to a bone in a model
Ok so what I am trying to do is crate a camera in code by using this
var myCam : Camera;
Then attaching it to the transform bone like this
var myCam : Camera;
var head : Transform;
public var model : GameObject;
function Start () {
model = GameObject.Find("usmarine_anim_Unity3D");
myCam = gameObject.AddComponent(Camera);
myCam.transform.position = head.transform.position;
myCam.transform.parent = head.transform;
}
But what happens is the camera is always at the guys feet not at his head where the cam harness is. Should I try to attach it directly to the head bone in the 3ds max biped skeleton system?
Thanks for any help with this
Comment
With the new edits it get the cam to be in the same position as the head transform but the cam is still at the guys feet and not his head any ideas?
Answer by MibZ · Jan 15, 2013 at 07:36 PM
Why can't you just add the camera manually in the editor as a child of the head?
I am using this as a prefab so I can spawn it into the game dynamically
Your answer