Search Unity

Error coping runtime gameobject to Editor

Discussion in 'Scripting' started by pesseba, Apr 10, 2009.

  1. pesseba

    pesseba

    Joined:
    Aug 14, 2008
    Posts:
    13
    I made a script to build a sequence of models connected with joints. The last segment is jointed with the first to save phisics interations limit stress... But when I copy the generated elements from runtime to editor mode and run again, the joint between the first and last elements doesn't work anymore. The sequence created at first time work properly, but I need to edit the phisics objects at runtime to make a prefab at the editor.

    Can I copy generated gameObjects from runtime to editor without problems? Does there is some mistake to avoid?
     
  2. pesseba

    pesseba

    Joined:
    Aug 14, 2008
    Posts:
    13
    I already fixed this problem, and I just knew the solution before and I didn't percieve it, my fault.
    The joints should be started with the models in right positions, else it will failed.
    When I run at first time, everything ok. But with the copied objects, its positions are modifyded by phisics, and the joints start in wrong position.
    The solution was to add a script and setup the right position of the last model in the start event script...

    just for knowing...