- Home /
Question by
seyitbaba590 · Jul 08, 2020 at 05:20 PM ·
c#animationprefabscripting beginnerspawn
creating animation made my each prefab spawn at same position
I create and empty object and make it move on z-axis and each 1 step on the axis create a cube but when i create an animation of cube, each cube being created at same position. how can i fix this? (also sorry for my bad english .d )
Comment
Answer by JonPQ · Jul 08, 2020 at 05:26 PM
add another empty parent object, put the animation on a child object called AnimationParentObject, then you can position or move the root with code, and the animation controls the children. Animating a transform always overwrites what you are doing in code, so put the animators on child objects and the code controlled stuff on the root.