- Home /
Using the animator to animate position?
Hi, I want to animate the position of an empty gameobject (that is childed to my player) based on certain actions my character could do (walking, jumping, etc). My plan is to animate the position and rotation of this empty gameobject then i can just child another gameobject to the empty and it will follow the animation as well. Im kind of new to the animator and animator controllers but I couldn't find anywhere in the animation window to animate local position.
isn't easy to do and manage with program$$anonymous$$g ins$$anonymous$$d of animating?
Answer by toddisarockstar · May 06, 2015 at 02:51 AM
this sounds like something that would be easier to create in blender or 3dmax or whatever modeling program you use. if your modeling program does not support an "empty object", simply delete the rendering component in unity after export so you cant see it. or you could even give it a transparent shader so you cant see it even though it is there.
I don't have a modeling program because I mostly work with sprites (i'm in no way an artist). What I'm trying to achieve is a way to attach any gameobject to my player in certain slots (like for weapons, accessories, etc). And these slots are just the empty gameobjects that follow my character around and have animations that match my characters. I want to be able to just child a gameobject to my character in these slots and have them be automatically animated because the slot is animated.
are you wanting the slots to simply follow at a fixed distance from the character? or are they following object parts? (like a hand or something). do the "slots" need any rotation?
sounds like its simply assigning parenting with script. maybe a long with using transform.point to asign a floating point. if i know jsut what you are doing i can give a quick code example to get you going.
Your answer
Follow this Question
Related Questions
2D Animation does not start 1 Answer
why I have to anim.getComponent in update() function when I had done in Start () function 2 Answers
Can the mecanim animators Controller var be set in code? 1 Answer
How can I create a home position where my character returns to after every animation? 0 Answers
Accessing AnimationState in Animator 0 Answers