Useful Components

This page will list the most commonly used components:

StaticMeshComponent

Extends MeshComponent. This component attaches a static mesh to an actor as well as adding the collision of that static mesh to the actor.

Properties

  • StaticMesh StaticMesh
    • The static mesh resource to attach to the actor

Functions

  • bool SetStaticMesh( StaticMesh NewMesh, optional bool bForce );
    • Sets a new static mesh on this instance

CylinderComponent

Extends PrimitiveComponent. A pure collision component with a width and a height. Used to add a collision cylinder to an actor. Note: invisible!

Properties

  • float CollisionHeight
    • The height of the cylinder
  • float CollisionRadius
    • The radius of the cylinder

Functions

  • SetCylinderSize(float NewRadius, float NewHeight);
    • Sets a new size of cylinder for this instance

Other Components

MeshComponent

Extends PrimitiveComponent. Base class of all mesh components.

Properties

  • array<MaterialInterface> Materials
    • Array of materials currently applied to this instance

Functions

  • MaterialInterface GetMaterial(int ElementIndex);
    • Returns the material from the materials array at the given index
  • SetMaterial(int ElementIndex, MaterialInterface Material);
    • Sets a new material in the materials array at the given index
  • int GetNumElements();
    • Returns the number of materials/number of submeshes in the materials array/mesh

PrimitiveComponent

Extends ActorComponent. Base class for many components that can be positioned on an actor and could provide collision information.

Properties

Transform
  • vector Translation;
    • Location, relative to owning actor
  • rotator Rotation;
    • Rotation, relative to owning actor
  • float Scale;
    • Uniform scale, relative to owning actor
  • vector Scale3D
    • 3D scale, relative to owning actor
Collision
  • bool CollideActors
    • Whether this component collides with other actors. In order for this to have any effect, the actor's bCollideActors property must also be true
  • bool BlockActors
    • Whether this component blocks other actors. In order for this to have any effect, the actor's bBlockActors property must also be true
Lighting
  • LightEnvironmentComponent LightEnvironment;
    • The light environment for this component. Useful for components that need to be 3D rendered, eg meshes. Meshes added to the world through the editor have this automatically set. Meshes on actors are considered dynamic and need to have their light environment explicitly set through this property. A good value for this property is a DynamicLightEnvironment component with default properties instantiated on the actor in the defaultproperties block.
  • bool CastShadow;
    • Whether this component casts a shadow at all
  • bool bCastDynamicShadow;
    • Whether this component casts a shadow from dynamic lights
  • bool bCastStaticShadow;
    • Whether this component casts a shadow from static lights
Visibility
  • bool HiddenGame;
    • Whether this component is invisible during game play
  • bool HiddenEditor;
    • Whether this component is invisible in the editor
  • bool bOwnerNoSee;
    • Whether this component is invisible to its owner
  • bool bOnlyOwnerSee;
    • Whether this component is only visible for its owner

Functions

Transform
  • SetTranslation(vector NewTranslation);
    • Sets relative location to owning actor
  • SetRotation(rotator NewRotation);
    • Sets relative rotation to owning actor
  • SetScale(float NewScale);
    • Sets relative scale to owning actor
  • SetScale3D(vector NewScale3D);
    • Sets relative 3D scale to owning actor
  • SetAbsolute(optional bool NewAbsoluteTranslation,optional bool NewAbsoluteRotation,optional bool NewAbsoluteScale);
    • Sets the above 3 values at the same time in the absolute/world
  • vector GetPosition();
    • Returns the world space location of this component
  • rotator GetRotation();
    • Returns the world space rotation of this component
Visibility
  • SetHidden(bool NewHidden);
  • SetOwnerNoSee(bool bNewOwnerNoSee);
  • SetOnlyOwnerSee(bool bNewOnlyOwnerSee);
Lighting
  • SetLightEnvironment(LightEnvironmentComponent NewLightEnvironment);