|
Hi there, I have a lot of levels to build by dragging & dropping prefabs from the project pane to the editor. These assets are balls that have their pivots at the center. However, i'd like to place them on top of a surface and they're always half stuck in the ground when I move them on the surface so I always have to incase the Y position for each object i drag in. Is there a way to place the objects on the surface without being stuck?
(comments are locked)
|
|
Make a script, and set it to run in Edit mode: http://unity3d.com/support/documentation/ScriptReference/ExecuteInEditMode.html In the Start function, set the Y position. If you just have a flat plane, it would be a constant, but if it's a variable surface, you can cast a ray down to find the floor. Attach it to your prefab. Have this just run in the editor. You can comment it out or remove it for run-time. But it should help you with initial placement. almost perfect. however, i have to run the game at least once in order to place all orbs on top of the plane. this isn't too bad but i'd like to see them in their final position immediately without starting the game
Dec 13 '11 at 12:06 AM
Somian
(comments are locked)
|
