URT3D Docs
  • ๐Ÿ“˜Welcome to URT3D Docs
  • Getting Started
    • ๐Ÿš€Quickstart
  • Basics
    • ๐ŸŒIntroduction to URT3D
    • ๐Ÿ”„How to Convert Your Files
    • โฌ†๏ธUpload Tips and Guidelines
    • ๐Ÿ“ฆUsing Your Converted Files
    • ๐Ÿ› ๏ธTroubleshooting Conversion
  • ๐Ÿ“‚ Developers
    • ๐Ÿ‘ฉโ€๐Ÿ’ปGetting Started with the SDK
    • ๐Ÿ‘จโ€๐Ÿ’ปUnity Integration Guide
    • ๐Ÿ—๏ธCore Concepts & Architecture
    • ๐ŸงฌTraits System
    • โœ๏ธScripting System
      • ๐ŸงพMiniScript Recipes
    • ๐Ÿ“˜API Reference
    • ๐Ÿ’กExamples and Best Practices
    • ๐Ÿ›ฐ๏ธAdvanced Topics
Powered by GitBook
On this page
  1. ๐Ÿ“‚ Developers

Traits System

Traits are modular behaviors you can add to any URT3D asset โ€” including movement, rotation, animation, and interactivity. Learn how to use them and create your own.

PreviousCore Concepts & ArchitectureNextScripting System

Last updated 1 month ago

๐Ÿ“˜ Looking for detailed implementation docs? This page gives you a high-level overview, but you can always dive deeper in the official SDK documentation on GitHub:

Traits are modular components that extend the functionality of a URT3D asset. Instead of relying on rigid inheritance or custom code for every new behavior, URT3D lets you add traits to assets as needed โ€” much like attaching Unity components.

Each trait encapsulates a single capability: position, rotation, animation, interactivity, and more.


๐Ÿ”น What Are Traits?

Traits are attached at the asset level. You can add them visually (via Inspector) or define them in a .urta file.

They are accessible via code like this:

var position = asset.GetTrait<TraitPosition3d>();
position?.SetValue(new Vector3(0, 1, 0));

Traits are also available inside MiniScript using GetTrait("TraitName").


๐Ÿ”น Common Built-In Traits

TraitPosition3d Controls the world position of the asset.

position = asset.GetTrait<TraitPosition3d>();
position.SetValue(new Vector3(0, 2, 0));

TraitRotation3d Handles local or global rotation.

rotation = asset.GetTrait<TraitRotation3d>();
rotation.SetValue(new Vector3(0, 90, 0));

TraitScale3d Enables scaling via Vector3 or uniform float.

scale = asset.GetTrait<TraitScale3d>();
scale.SetValue(1.5f);

TraitAnimatable Plays, stops, or loops named animation clips embedded in the asset.

anim = asset.GetTrait<TraitAnimatable>();
anim.PlayAnimation("Idle", true);

TraitInteractable Exposes user interactions like clicks and hover events.

var interactable = asset.GetTrait<TraitInteractable>();
interactable.OnClicked += args => Debug.Log("Clicked!");

๐Ÿ”น Custom Traits

You can create your own traits by subclassing the Trait base class.

public class TraitHealth : Trait
{
    public float CurrentHealth { get; set; }
    public void TakeDamage(float amount) { ... }
}

Traits integrate with the Inspector and can be saved into .urta files for reuse.


๐Ÿ”น In MiniScript

Inside MiniScript, you can use traits like this:

position = GetTrait("Position3d")
position.SetValue(Vector3(0, 1, 0))

Use HasTrait() to check if a trait exists before calling it.


๐Ÿ”น Why Traits Matter

โ€ข Traits reduce boilerplate setup โ€ข Traits are portable between assets โ€ข Traits keep asset behavior modular and composable โ€ข Traits are compatible with scripting and drag-and-drop workflows


๐Ÿ’ฌ Need Help?

๐Ÿ“ฉ Email us at:

๐Ÿงฌ
urt3d-sdk_unity โ€บ Documentation
๐Ÿ—จ๏ธ Join our Discord creator community
support@urt3d.com