UDN
Search public documentation:

UsingStaticMeshActors
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > Static Meshes > Using StaticMeshActors
UE3 Home > Level Designer > Using StaticMeshActors

Using StaticMeshActors


Overview


Static meshes are one of the foundational types of renderable geometry in Unreal Engine 3. In order to use these meshes to populate your worlds, the StaticMeshActor is used. This is a type of actor that displays a single StaticMesh and cannot move or be modified during play, i.e. it is static. These actors are used to create the majority of the world geometry within maps.

staticmeshactor.jpg

Placement


StaticMeshActors are placed in maps using standard actor placement methods; either through the right-click context menu of the viewports or drag and drop from the Content Browser.

Context Menu

  1. In the Content Browser, select the StaticMesh you want to add to the map as a StaticMeshActor.
    place_select.jpg
  2. Right-click in the viewport where you want to add the mesh and choose Add StaticMesh: [MeshAssetPath] from the context menu. The location does not need to be exact. You can always reposition, rotate, scale the mesh afterwards.
    place_context_add.jpg
  3. The StaticMesh has been placed in the map as a StaticMeshActor, as seen in the Property Window.
    place_complete.jpg

Drag and Drop

  1. In the Content Browser, locate the StaticMesh you want to add to the map as a StaticMeshActor.
    place_select.jpg
  2. Left-Click on the StaticMesh in the Content Browser and drag the mouse (while holding the left mouse button down) from the Content Browser to the location in the viewport where you want to place the mesh. The location does not need to be exact. You can always reposition, rotate, scale the mesh afterwards.
    place_drag.jpg
  3. Release the left mouse button to place the mesh in the map as a StaticMeshActor, as seen in the Property Window.
    place_complete.jpg

Conversion to/from Other Actors


StaticMeshActors can be converted to and from certain other types of actors which display a StaticMesh through the right-click context menu of the viewports. This can be handy should you decide that you want a mesh previously placed in the map as a KActor or InterpActor to be a StaticMeshActor, or vice-versa.

Converting to a StaticMeshActor

  1. In the viewport, select the actor you want to convert to a StaticMeshActor.
    convert_select.jpg
  2. Right-Click on the actor and choose Convert > Convert [CurrentActorType] to StaticMeshActor.
    convert_context.jpg
  3. The actor has been converted to a StaticMeshActor, as seen in the Property Window.
    convert_complete.jpg

Converting from a StaticMeshActor

The process of converting from a StaticMeshActor to another type is the same as the process for converting to a StaticMeshActor shown above. The types of actors that a StaticMeshActor can be converted to are listed below:

Material Override


The Material(s) applied to a StaticMesh can be overridden on a per-actor basis. This allows a single StaticMesh asset to be used multiple times in a single map or throughout your game while giving each a unique appearance. The Materials property located in the Rendering category of the StaticMeshComponent of the StaticMeshActor is an array of Materials that directly maps to those applied to the StaticMesh asset through the Static Mesh Editor. Materials can be assigned to the array manually or they can be applied directly to the mesh in the viewport by dragging and dropping from the Content Browser.

Manual Assignment

  1. In the viewport, select the StaticMeshActor you want to assign a new Material to and press F4 to open its properties in the Property Window.
    material_properties.jpg
  2. In the Rendering category of the StaticMeshComponent, add a new item to the Materials array by clicking the add_item_button.jpg button. If the StaticMesh has more than one material slot, you may need to add more than one item as the items in the array match the material slots of the StaticMesh.
  3. In the Content Browser, select the Material you want to apply to StaticMeshActor in the map.
    material_select.jpg
  4. Press the use_selected_button.jpg button for the corresponding item in the Materials array to assign the material. The mesh is now displayed with the Material applied.
    material_complete.jpg

Drag and Drop

  1. In the Content Browser, locate the Material you want to apply to StaticMeshActor in the map.
    material_select.jpg
  2. Left-Click on the Material in the Content Browser and drag the mouse (while holding the left mouse button down) from the Content Browser to the section of the StaticMeshActor in the viewport you want to apply the Material to.
    material_drag.jpg
  3. Release the left mouse button to apply the Material. The mesh is now displayed with the Material applied and the Materials array in the Property Window has been updated.
    material_complete.jpg

Collision


By default, StaticMeshActors use the COLLIDE_BlockAll Collision Type. This means they will block all actors and traces in the world. Since StaticMeshActors are generally used for placing world geometry, this is usually the desired behavior. However, collision calculations do have a cost so any StaticMeshActors that do not need to collide with other actors should have their collision disabled. For instance, StaticMeshActors used as small decorations or background environments that are unreachable by the player may not need to actually block anything.

The selected StaticMeshActor is a decorative mesh that probably doesn't need collision.
collision_deco.jpg

The selected StaticMeshActors outside the window make up the background environment where the player is never able to reach.
collision_unreachable.jpg

Collision Types

The Collision Type property is a method of exposing several collision settings in a simple way. Changing this value in Unreal Editor will set the low level flags such as CollideActors, BlockActors, BlockNonZeroExtent, BlockZeroExtent and BlockRigidBody on the Actor and its CollisionComponent to match the description of Collision Type.

Collision Type Description
COLLIDE_CustomDefault Programmer set collision. This restores collision to defaults set in the default properties when selected.
COLLIDE_NoCollision The Actor will neither block nor touch other actors or traces.
COLLIDE_BlockAll The actor will block other actors and traces.
COLLIDE_BlockWeapons The actor will block zero extent traces only, such as instant hit weapons.
COLLIDE_TouchAll The actor will touch other actors and traces.
COLLIDE_TouchWeapons The actor will touch zero extent traces only, such as instant hit weapons.
COLLIDE_BlockAllButWeapons The actor will block other actors and non-zero extent traces only.
COLLIDE_TouchAllButWeapons The actor will touch other actors and non-zero extent traces only.
COLLIDE_BlockWeaponsKickable Same as COLLIDE_BlockWeapons, but also enables the actor to be kicked by player physics.

Collision Properties

Collide Complex
If enabled, simplified collision geometry on this actor will be ignored and collision will be performed per-polygon. Simplified collision geometry is generated in Unreal Editor or within a 3D content creation package. Colliding per polygon is useful for non-zero extent traces so that bullets will collide accurately. Colliding per-polygon is not recommended for Actor movement as it is expensive to do so.
Block Rigid Body
if enabled, Actors using PhysX should collide against this actor.
No Encroach Check
If enabled, encroachment checking when this Actor is moved is turned off. Enabling this speeds up the game, but the actor will not be able to touch triggers, push players, enter or exit volumes.
Path Colliding
If enabled, this Actor can block paths during path building in Unreal Editor.
Collision Component
Reference to the component used for collision calculations of this Actor.

Distance Culling


Visibility of StaticMeshActors can be controlled based on the distance from the camera using the MinDrawDistance and MaxDrawDistance properties of the StaticMeshComponent (located under the Rendering category). These two properties allow you to specify both a minimum and maximum distance from the camera where the static mesh of the actor will be rendered.

distance_cull.jpg

The ability to control the distance at which meshes are rendered can be used simply to hide meshes when the player is too far to see them (as shown above), or it can be used to swap out one or more higher-resolution meshes for low-resolution proxies (or a single proxy taking the place of multiple high-res meshes) by placing multiple StaticMeshActors in the same location(s) where the MinDrawDistance of the low-res mesh(es) is the same as the MaxDrawDistance of the high-res mesh(es).

distance_swap.jpg

Of course, simply using the LOD system inherent to StaticMeshes could perform the same function as shown above, but this method allows the level designer to handle the setup as the Mesh Simplification Tool can be used to create low-res versions of existing meshes directly in Unreal Editor. And, as mentioned previously, multiple higher-res meshes can be swapped out for a single low-res proxy that in order to not only lower the poly count, but the number of draw calls as well. This same concept is the basis for the Massive LOD system.

See Visibility Culling for more information on how the visibility of static meshes and other geometry controlled in UE3.