AFM_MeshCopy
Creates a duplicate of an actor's meshes under a new material, shared by highlighting, snapping previews and visibility transitions.
What it gives you
- Ghost copies of any actor's geometry
- Fade in and out with sound
- Colour interpolation on the copy
Requires
Required by
Description
Several framework features need to draw a copy of an object: the mesh-copy highlight style, the
snapping preview ghost, and the visibility fade. BP_Helper_MeshCopy provides that once.
It duplicates the source mesh components — including instanced static meshes — applies a single material to all of them, and provides timeline-driven show and hide transitions with optional sound.
Setup
This module is used by other systems rather than configured directly: AFS_Core_Highlight, AFS_Core_Snapping and AFM_Visibility build on it.
Usage
Creating a copy
Spawn BP_Helper_MeshCopy, call CreateDuplicateMeshComponent with the meshes to copy, set
Material, then SetVisibility to fade it in.
Colour
SetColor for an immediate change, InterpolateToColor to blend.
Key properties
| Property | When to change |
|---|---|
Material | The material the copy is drawn with |
Anim Duration | Fade duration |
Sound Show / Sound Hide | Transition feedback |
Extending
Derive and override getVisibilityTimeline for a different transition curve — BP_Helper_MeshCopy_Visibility and BP_Helper_MeshCopy_Anchor are the shipped examples.
Performance notes
A copy doubles the draw calls for that object while visible. Destroy copies after fade-out — SetVisibility takes a flag to do this automatically.
Example map
Visible as the ghost preview in Map_Examples_Snapping and as a highlight style in Map_Examples_Highlight.
Troubleshooting
The copy is invisible. No material assigned, or the source meshes were not passed to CreateDuplicateMeshComponent.
API reference
Every blueprint asset in this module. Expand an asset to see its members.
Helper
BP_Helper_MeshCopy16 members
Ghost actor that duplicates another actor's mesh components and follows them every frame, so the copy can be faded, tinted or given a different material without touching the original. Highlights, previews, snap ghosts and the visibility switch are all built on it. Spawned rather than placed; subclass it when a copy of your own needs its own fade curve.
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | Initial Mesh ComponentsInitial | MeshComponent[] | Mesh components that were duplicated to build this copy. Filled in when the copy is created. |
| var | MaterialInitial | MaterialInterface | Material applied to every duplicated mesh, replacing the source materials. This is what gives the copy its highlight, preview or fade appearance. |
| var | Anim DurationConfig | float | Duration in seconds of the show and hide transition. |
| var | VisibleInitial | bool | Whether the copy is currently shown. Set through Set Visibility so the transition plays. |
| var | ColorInitial | LinearColor | Colour written into the copy's material. Change it through Set Color or Interpolate To Color. |
| var | Sound ShowSound | SoundBase | Sound played when the copy fades in. |
| var | Sound HideSound | SoundBase | Sound played when the copy fades out. |
| fn | CreateDuplicateMeshComponent | (out MeshComponentsToDuplicate: MeshComponent[], out MeshComponentsMap: Map<MeshComponent, MeshComponent>) | Duplicates the given mesh components onto this actor and returns a map from each source mesh to its copy. |
| fn | getVisibilityTimeline | (out ShowMaterial: TimelineComponent) | Returns the timeline driving the show and hide transition. Override in a subclass to use a different transition curve. |
| fn | AddInstances | (MirroredMesh: InstancedStaticMeshComponent, InitialMesh: InstancedStaticMeshComponent) | Mirrors the instances of an instanced static mesh onto the duplicate, so instanced geometry copies correctly. |
| event | SetVisibility | (Set: bool, DestroyAfterTransitionEnded: bool) | Fades the copy in or out, optionally destroying the actor once a fade-out finishes. |
| event | SetAnimationDuration | (AnimDuration: float) | Changes the transition duration at runtime. |
| event | TransitionFinished | () | Fires when a show or hide transition completes. |
| event | SetColor | (Color: LinearColor) | Sets the copy's colour immediately, without interpolation. |
| event | InterpolateToColor | (Color: LinearColor) | Blends the copy's colour towards the target over time. |
| event | ApplyMaterialToMeshes | () | Re-applies the configured material to every duplicated mesh, after the material or meshes change. |