realitykit-entities

Load and compose RealityKit 3D content in visionOS using RealityView, entities, and USDZ models.

Updated Jun 8, 2026
One-click install
npx skills add https://github.com/likw99/agent-plugins --skill realitykit-entities-likw99
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: realitykit-entities
Source: https://github.com/likw99/agent-plugins/tree/main/plugins/build-visionos-apps/skills/realitykit-entities
Command: npx skills add https://github.com/likw99/agent-plugins --skill realitykit-entities-likw99

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Displaying 3D models in visionOS requires choosing between SwiftUI's Model3D and RealityKit's RealityView, handling asynchronous USDZ loading, normalizing unpredictable model scale, and wiring up interaction components—mistakes in any of these cause invisible models, frozen UIs, or gestures that silently fail. ## Core Features & Use Cases - API Selection Guidance: A decision tree for choosing Model3D, RealityView, Reality Composer Pro bundles, or runtime USDZ loading based on scene complexity and interaction needs. - Entity Component System Patterns: Concrete Swift code for transforms, materials, collision shapes, InputTargetComponent, custom components, and systems in meters-based coordinate space. - Robust Async Loading: Patterns for loading USDZ from bundle, disk, or network with scale-to-fit helpers and explicit loading/failure UI states. - Use Case: Build a 3D model viewer that downloads a generated USDZ file, scales it to fit a 0.5-meter volume, centers it, and lets users tap and rotate it with spatial gestures. ## Quick Start Use the realitykit-entities skill to load a USDZ model into a RealityView, scale it to fit half a meter, and add tap gesture interaction with loading and error states.

Frequently Asked Questions about realitykit-entities

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

FAQPage Schema
How do I load a USDZ model into a RealityView in visionOS?▼

Load USDZ files with try await Entity(contentsOf:) or ModelEntity(contentsOf:) inside RealityView's async make closure, then add the entity with content.add(). For remote URLs, download the file locally first since RealityKit only loads from file URLs.

Should I use Model3D or RealityView for displaying 3D models in SwiftUI?▼

Use Model3D for a quick declarative single model in a window or volume with built-in placeholder handling. Use RealityView when you need multiple entities, custom interaction, per-frame updates, or fine control over the scene graph.

Why do gestures not work on my RealityKit entities?▼

Gestures silently fail unless the entity has both an InputTargetComponent and a collision shape. Call entity.components.set(InputTargetComponent()) and entity.generateCollisionShapes(recursive: true) before attaching gestures like TapGesture().targetedToAnyEntity().

How do I fix USDZ models appearing too large or invisible in visionOS?▼

Imported models have unpredictable scale, so measure them with visualBounds(relativeTo:) and normalize with a scaleToFit helper that divides your target size by the longest bounding edge. RealityKit units are meters, so also recenter the model by subtracting the bounds center.

Can RealityKit load USDZ files directly from a remote URL?▼

No, RealityKit loads only from local file URLs. Download the remote file with URLSession to a temporary directory first, then pass that local file URL to Entity(contentsOf:) or ModelEntity(contentsOf:).