actors-and-components

Build and compose Unreal Engine gameplay objects from Actors and Components in C++.

1|Updated Sep 6, 2026
One-click install
npx skills add https://github.com/ziyarduc/Baran-bk-game --skill actors-and-components-ziyarduc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: actors-and-components
Source: https://github.com/ziyarduc/Baran-bk-game/tree/main/.agents/skills/actors-and-components
Command: npx skills add https://github.com/ziyarduc/Baran-bk-game --skill actors-and-components-ziyarduc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Unreal Engine C++ developers frequently hit lifecycle and composition bugs: BeginPlay not firing, runtime components that never render or collide, attachment rules that snap objects to the wrong place, and overlap events that silently fail. This Skill provides the canonical AActor lifecycle order, the component type hierarchy, and correct patterns for spawning, attaching, and registering components so these issues are avoided or diagnosed quickly. ## Core Features & Use Cases - Lifecycle guidance: Documents the full AActor creation paths (load-from-disk, PIE duplication, SpawnActor, deferred spawn) and the exact callback order from constructor through BeginPlay, EndPlay, and garbage collection. - Component composition: Explains the UActorComponent / USceneComponent / UPrimitiveComponent tiers, root component selection, attachment rules, sockets, mobility, and runtime component registration. - Spawning and destruction: Covers SpawnActor variants, FActorSpawnParameters, collision handling overrides, deferred spawn for pre-BeginPlay configuration, and object pooling. - Use Case: When creating a pickup actor with a USphereComponent trigger and a UStaticMeshComponent visual, follow the provided code pattern to set the root, attach in the constructor with SetupAttachment, and bind the overlap UFUNCTION in BeginPlay. ## Quick Start Ask the AI to create a new Unreal C++ actor with a collision sphere root and an attached static mesh that fires an overlap event when the player walks into it.

Frequently Asked Questions about actors-and-components

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an actor with components in Unreal C++?▼

Subclass AActor, declare component pointers as UPROPERTY TObjectPtr members, and create them in the constructor with CreateDefaultSubobject. Set one USceneComponent as the root with SetRootComponent and attach children using SetupAttachment.

How do I spawn an actor at runtime in Unreal Engine?▼

Call GetWorld()->SpawnActor with a TSubclassOf class, transform, and FActorSpawnParameters. Use SpawnActorDeferred plus FinishSpawning when the actor needs properties set before BeginPlay runs, such as projectile damage.

Why does my runtime component not render or collide in Unreal?▼

Components created at runtime with NewObject must call RegisterComponent to associate with the world scene. Without registration the component will not tick, render, or participate in collision, unlike constructor-created default subobjects which register automatically.

Why is my overlap event not firing in Unreal Engine?▼

The bound function must be a UFUNCTION with the exact delegate signature or AddDynamic silently fails. Both primitives also need collision enabled, SetGenerateOverlapEvents(true), and overlapping collision response channels.

What is the difference between SetupAttachment and AttachToComponent?▼

SetupAttachment is for the constructor or unregistered components and defers the attach until registration. AttachToComponent attaches immediately at runtime; calling SetupAttachment on an already-registered component does nothing.

Should gameplay logic go in the constructor or BeginPlay?▼

Gameplay logic belongs in BeginPlay. The constructor also runs on the Class Default Object and in the editor with no valid world, so spawning, timers, world queries, and delegate bindings placed there will fail or behave unpredictably.