- Home /
Problem is not reproducible or outdated
Animation data for non mesh purposes
Hi there, I wanted to know if it is possible to read out animation data to be used to move objects around rather than the intended vertices.
For instance: The animation data has information to animate a low poly mesh with vertices 0,1,2,3,4,5. In my scene I would have 6 objects (obj0,obj1,obj2,obj3,obj4,obj5). Is it possible to use the animation data intended for vertex location to be used as a Vector3 to move my objects around in the way normally the vertex should move?
I know it is a confusing question, but any insight would be great.
ps. I know there are options like bakeMesh for a snapshot of every vertex position, but those methods are a to big hit on performance, that is why i want to manually read out the animation data for the use of my objects position.
Answer by GameVortex · Jan 06, 2014 at 09:16 AM
Animations do not animate vertices directly. They move the joints which the vertices are attached to. The joints are GameObjects. So using an animation to move objects around is exactly what animations are used for. You can not read the animation data directly to apply the movement in script though. You will have to play the animation directly on your gameobjects. Take a look at the **Animation View** in the manual and see that you can add the Position, Rotation and Scale of the object as curves to the animation.
Ok, but so far it is not possible to use a joint animation to get the "vertex position" without having a mesh that is animated? Because all I need is use (possible) animation data (bones) on a swarm of objects in the same way vertices would be animated by bones.
So basically ins$$anonymous$$d replacing a vertices mesh with a swarm of objects having the same name as the vertices.