Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Animating formations of a cluster of cube objects.

Discussion in 'Animation' started by matbrummitt, Sep 27, 2013.

  1. matbrummitt

    matbrummitt

    Joined:
    Jan 12, 2010
    Posts:
    107
    Hi all,

    I am in the early phases of making a new game and doing some R&D on some of the main features I have planned, and I'm hoping some of you here can offer some advice on something, animating the formation of a cluster of cubes. Let me clarify:

    Say I have around 100 cube game objects that start off forming a large cube. I want these 100 cubes to be able to animate themselves into other shapes when I want them to. For example, they might form the shape of an airplane, or become walkable terrain as well as many other things.

    So my question is how would you recommend setting up these formations, and animating between them?

    My initial thoughts are that each formation should have its own class, being a stored list of predefined local positions for the cubes to exist at. These positions would be local positions, so the cubes' parent game object can move about and the child cubes would go along with it and still be able to make their formations in any area of the level. The cubes could then be animated over time to simply move and rotate into place, and the formation could be changed at runtime simply by instantiating a new formation. Does this sound like a good idea or is there is a better way?

    Thanks

    Mat
     
    Last edited: Sep 27, 2013