Refining the object placement

After placing the objects in the world with just the Follow Terrain or Snapping to Objects, you might find that you will need to adjust the position, rotation, or scale of the object. In this recipe, we will show you the basics of how you might be able to do so along with a few hotkey shortcuts to make this process a little faster. This works with any object that is placed in your level, from Entities to Solids.

Getting ready

  1. Have My_Level open inside of Sandbox (after completing either the Terrain sculpting or Generating a procedural terrain recipe).
  2. Review the Navigating a level with the Sandbox Camera recipe to get familiar with the Perspective View.
  3. Make sure you have the EditMode ToolBar open (right-click on the top main ToolBar and tick EditMode ToolBar).
  4. Place any object in the world.

How to do it...

In this recipe, we will call your object (the one whose location you wish to refine) Box for ease of reference.

  1. Select Box.
  2. After selecting Box, you should see a three axis widget on it, which represents each axis in 3D space. By default, these axes align to the world:
    • Y = Forward
    • X = Right
    • Z = Up

    To move the Box in the world space and change its position, proceed with the following steps:

  3. Click on the Select and Move icon in the EditMode ToolBar (1 for the keyboard shortcut).
  4. Click on the X arrow and drag your mouse up and down relative to the arrow's direction.
  5. Releasing the mouse button will confirm the location change.

You may move objects either on a single axis, or two at once by clicking and dragging on the plane that is adjacent to any two axes: X + Y, X + Z, or Y + Z. To rotate an object, do the following:

  1. Select Box (if you haven't done so already).
  2. Click on the Select and Rotate icon in the EditMode ToolBar (2 for the keyboard shortcut).
  3. Click on the Z arrow (it now has a sphere at the end of it) and drag your mouse from side to side to roll the object relative to the axis.
  4. Releasing the mouse button will confirm the rotation change.

You cannot rotate an object along multiple axes. To scale an object, do the following:

  1. Select Box (if you haven't done so already).
  2. Click on the Select and Scale icon in the EditMode ToolBar (3 for the keyboard shortcut).
  3. Click on the CENTER box and drag your mouse up and down to scale on all three axes at once.
  4. Releasing the mouse button will confirm the scale change.

It is possible to scale on just one axis or two axes; however, this is highly discouraged as Non-Uniform Scaling will result in broken physical meshes for that object. If you require an object to be scaled up, we recommend you only scale uniformly on all three axes!

There's more...

Here are some additional ways to manipulate objects within the world.

Local position and rotation

To make position or rotation refinement a bit easier, you might want to try changing how the widget will position or rotate your object by changing it to align itself relative to the object's pivot. To do this, there is a drop-down menu in the EditMode ToolBar that will have the option to select Local. This is called Local Direction.

This setup might help to position your object after you have rotated it.

Grid and angle snaps

To aid in positioning of non-organic objects, such as buildings or roads, you may wish to turn on the Snap to Grid option. Turning this feature on will allow you to move the object on a grid (currently relative to its location). To change the grid spacing, click the drop-down arrow next to the number to change the spacing (grid spacing is in meters).

Angle Snaps is found immediately to the right of the Grid Snaps. Turning this feature on will allow you to rotate an object by every five degrees.

Ctrl + Shift + Click

Even though it is a Hotkey, to many developers this hotkey is extremely handy for initial placement of objects. It allows you to move the object quickly to any point on any physical surface relative to your Perspective View.

See also

  • The Placing the objects in the world recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.166.131