On this page
Character Setup Reference
New here? Follow the short quick start first. This reference explains scene settings, materials, Controllers and gameplay integration in more detail.
1. Installation and scene requirements
- Install ECSAnimator through Package Manager > My Assets > Import, or Assets > Import Package > Custom Package for a supplied
.unitypackage. Keep the package files selected and wait for compilation. A separately supplied UPM.tgzuses Add package from tarball. - Use Unity 2022.3.1f1 or a compatible patch with URP 14 or HDRP 14. Dependencies resolve from package.json. Keep one copy of
com.asterism.ecsanimatorunder Packages. - Enable SRP Batcher and Graphics > BatchRendererGroup Variants > Keep All. Keep one enabled MainCamera, Display 1, no Target Texture or XR/stereo. HDRP requires Linear color space; URP allows Gamma or Linear.
- Import Demos from Package Manager > ECSAnimator > Samples. Choose Tools > ECSAnimator > Demos > Use URP Preview or Use HDRP Preview, then enter Play. Both use the same prebuilt character resources. See pipeline setup, including the old Entities dual-package compatibility requirement.
For a minimal gameplay example, import Quick Start, place NewcomerQuickStart.prefab in a scene with pipeline-appropriate lighting, and enter Play. Legacy Input Manager/Both enables its keyboard controls; Input System-only projects still display Idle. Windows D3D11 is the validation baseline; see platform boundaries.
2. Global settings
Open Tools > ECSAnimator > Settings. If missing, select Create global settings (Motion ON). Keep exactly one Resources/ECSAnimator/ECSAnimatorSettings.asset while Worlds are alive.
Enable Motion Vectors controls character velocity for all ECSAnimator Worlds, independently of camera effects. It defaults on; an existing asset applies field changes on a subsequent update. Loading, moving or unloading the shared Settings resource while a World is alive is unsupported.
3. Prepare your Prefab and materials
Use a saved Prefab with a selectable Animator, Controller, valid bones and a readable skinned mesh. Meshes require Position, Normal, Tangent, UV0 and triangle submeshes. One Animator is compiled. Root Motion, Unity IK callbacks and state scripts are omitted; implement gameplay through ECS and custom pose processing. Check the component table for other source features, including BlendShapes and multiple Animators.
Create Assets > Create > ECSAnimator > Lit Material, assign it to the source renderers, and transfer this supported PBR subset. Native URP/Lit and HDRP/Lit materials are not automatically adapted by character conversion.
| Source property | ECSAnimator/Lit |
|---|---|
| Base map / color | Base Map / Base Color |
| Normal map / scale | Normal Map / Normal Scale; Normal Enabled = 1 |
| Metallic / smoothness | Metallic / Smoothness |
| Alpha clipping / threshold | Alpha Clip / Cutoff |
Keep one supported Shader profile throughout a character; package-owned and External profiles cannot be mixed. External Shaders/Graphs require adaptation and remain Preview.
4. Build a minimal Idle/Run Controller
- Add a Float parameter named Speed and states Idle / Run.
- Use
Speed > 0.1for Idle to Run andSpeed < 0.1for Run to Idle. Start with Has Exit Time off and a short transition. - Assign the Controller to the Prefab and save the Controller, Prefab and materials.
- Open Tools > ECSAnimator > Convert Character. Assign the Prefab, fix blocking Preview findings, then Build.
- Use the selected
<PrefabName>_EntityDesc.asset(CharacterRuntimeAsset) in the next step. Rebuild after changing source animation, Controller, mesh, material or Shader.
Create Assets > Create > ECSAnimator > Convert Preset to save source, identity and output settings. Enable Require Pose Processing before building a character that needs IK or a custom pose processor. See conversion fields and outputs.
Generated meshes/materials and animation are owned by the EntityDesc; textures and Shaders remain referenced dependencies. Rebuilds preserve the published GUID and last successful result. V4/V5 data must be rebuilt to V6 from source. Use recovery and upgrades rather than editing generated data or digests.
5. Move your character
After importing Quick Start, add SimpleCharacterExample to an empty GameObject:
- Assign your generated EntityDesc.
- Set Speed Parameter to the exact, case-sensitive Float parameter name.
- Use DefaultWorld for a single live World; streaming/conversion helper Worlds are ignored. For client/server or other multiple-World projects, select NamedWorld with its exact unique name.
- Enter Play and use WASD with Legacy Input Manager/Both. Move Speed is world units per second; the animation parameter receives speed magnitude.
SimpleCharacterExample.cs contains spawning, parameter writes, ECS movement and cleanup. It demonstrates a short main-thread integration, not an efficient command loop for ten thousand characters. For batches/Jobs, use NewcomerAnimationBridgeSystem.cs.
The separate combat example NewcomerCodeSpawner uses exact keys: Speed, Direction, Grounded, UpperBody/Attack#1, FullBody/Hit#1 and FullBody/Death#2. Those state paths belong to its supplied Controller. Its Presentation Event is the animation event's function name, normally ECSAnimatorEvent; event.attack.contact is a payload, not that key. A Speed-only Controller should use SimpleCharacterExample.
6. Connect your System or AI
SimpleCharacterMovementSystem uses Burst/IJobEntity to read SimpleCharacterVelocity and write LocalTransform before Transform updates. Disable Read Keyboard to call example.SetVelocity(new float3(0, 0, 2)) from C#, or write the velocity in an ECS system:
using ECSAnimator.Runtime.Product.ECS;
using ECSAnimator.Runtime.Product.Samples.Newcomer;
using Unity.Entities;
using Unity.Mathematics;
[UpdateInGroup(typeof(CharacterAnimationIntentProducerSystemGroup))]
[UpdateBefore(typeof(SimpleCharacterMovementSystem))]
public partial struct GameVelocitySystem : ISystem
{
public void OnUpdate(ref SystemState state)
{
foreach (var velocity in SystemAPI.Query<RefRW<SimpleCharacterVelocity>>())
velocity.ValueRW.Value = new float3(0, 0, 2);
}
}
Put this script in a separate directory with Game.CharacterSystems.asmdef:
{
"name": "Game.CharacterSystems",
"references": [
"ECSAnimator.Runtime.Product", "ECSAnimator.Runtime.Product.Newcomer",
"Unity.Entities", "Unity.Mathematics", "Unity.Collections"
]
}
Generated SystemAPI.Query code also needs Unity.Collections. Add Unity.Transforms when accessing transforms and Unity.Burst when using Burst. Never reference Editor assemblies from Player code.
The Simple example writes commands from MonoBehaviour.Update for a later ECS update. For strict ordering within one Simulation update, use IntentProducer > Transform > AnimationBridge > Evaluation. If the previous command is still pending, Simple retries the latest Speed on a later update without blocking or destroying the character. This is suitable for continuous parameters, not guaranteed one-shot delivery.
Copy/rename sample gameplay types for production integrations. Give each character position one writer. Moving the Spawner GameObject after spawning does not move the Entity. Collision, navigation and damage remain gameplay responsibilities.
7. Control parameters, states and layers
Animation clients use exact Controller parameter names, layer names and exported state paths. Inspect GetStateMetadata(i).Key for states. No gameplay aliases or short state names are generated. Rebuild after source renames and use the matching type: a Float cannot be written with an Int API.
| Animator intent | ECSAnimator main-thread API |
|---|---|
| SetFloat / SetInteger / SetBool | TrySetFloat / TrySetInt / TrySetBool |
| SetTrigger / ResetTrigger | TrySetTrigger / TryResetTrigger |
| SetLayerWeight | TrySetLayerWeight |
| Play / PlayInFixedTime | TryPlay / TryPlayFixedTime |
| CrossFade / CrossFadeInFixedTime | TryCrossFade / TryCrossFadeFixedTime |
Create one shared client per producer/asset, not one per character per frame:
// runtime, prepared and character come from the loading/spawning workflow.
if (!runtime.TryCreateAnimationClient(prepared, "game.player", new[] { "Speed", "Attack" },
out var client, out var error))
throw new System.InvalidOperationException(error);
During an update, bind once and write multiple distinct parameters. Attack must be a Trigger. Keep attackPending until writing succeeds:
if (client.TryBind(character, out var animator, out var error))
{
if (!animator.TrySetFloat("Speed", speed, out error))
UnityEngine.Debug.LogError(error);
if (attackPending && animator.TrySetTrigger("Attack", out var request, out error))
attackPending = false; // Written, not yet accepted, played or applied as damage.
}
The returned animator is valid only for that update. Do not cache it across frames or repeatedly bind thousands of targets. Retry on a later frame if busy. For reliable one-shot behavior, retain the request and follow the receipt/Matches workflow. Acceptance, Trigger consumption and visual events are separate moments; animation events are not authoritative damage decisions.
Use the batch/Jobs sample for crowds: resolve typed handles, reserve once, schedule, call RegisterProducer(jobHandle), and consume current-frame results in CharacterEventSystemGroup. See complete integration instructions.
8. Cleanup and uninstallation
The Simple example calls StopCharacter from OnDisable/OnDestroy:
- Stop your command producers; unregister the advanced sample's bridge.
- Dispose the animation client.
- Destroy the character or its scope.
- Release the prepared asset.
Release may span frames. Keep the prepared object and observe prepared.ReleaseState until Released before unloading dependencies. Invalid and FaultedRetainedRequiresWorldRebuild are not success. Do not busy-wait Pending on the main thread or dispose shared Blobs/GPU buffers yourself. After a World rebuild, reacquire every runtime, prepared object and handle.
Before removing the package, remove unused consumer scripts/assembly references, generated content and imported samples, then wait for compilation and remove ECSAnimator in Package Manager. Source Prefabs, Controllers, textures and clips are not automatically deleted.
Troubleshooting
| Symptom | Check first |
|---|---|
| Build disabled / SHD010 | ECSAnimator/Lit or correctly adapted External Shader; saved inputs |
| Spawn succeeds but nothing is visible | Cached or explicitly bound LOD camera, position/layers, active pipeline, SRP Batcher, DOTS variants and Console |
| Required binding key missing | Exact parameter name and type, rebuilt data, correct sample for the binding contract |
| Visible but not moving | Legacy Input Manager/Both, Read Keyboard, or your velocity-producing System |
| Renamed parameter has no effect | Rebuild and update the exact Controller keys |
| Release remains Pending | Stop producers, dispose clients, continue World updates and inspect returned details |
| Shader/material edits have no effect | Edit the source and rebuild, not the generated snapshot |
| Rigid weapon is omitted | Valid nearest CharacterAttachmentAuthoring, one MeshFilter/sharedMesh and an in-character Owner Bone |
| Mesh unreadable / invalid vertex streams | Read/Write Enabled, complete normals/tangents/UV0, triangle topology |
| LOD build fails | One valid enabled LODGroup, no crossfade, distinct meshes with decreasing vertices and triangles |
| Missing collision/navigation on Entity | These behaviors require game-owned ECS components and systems |
| Animation stays at its beginning | Do not submit Play/CrossFade to zero every frame |
| Parameter writes do not transition | Exact Controller key/type, conditions/Exit Time, conflicting writers and receipts |
| World unavailable / ambiguous | Initialize ECS; select the exact unique NamedWorld and reacquire handles after rebuild |
Include Unity/package versions, Editor or Player, graphics API, complete diagnostic code/object path, reproduction steps, parameter types and declared binding keys in a support report. For Shader issues, include source configuration and shadow/depth comparisons rather than only the final “Build failed” line.
Before shipping your project
First test spawning, parameters, movement, events/attachments and destruction in a small scene. Then profile your intended population, mesh/material counts, LOD and motion settings. Sample counts are not performance guarantees. Keep EntityDesc assets, dependencies, Settings and DOTS variants in the Player and test the actual loading route.
Back up sources, generated assets and metadata before upgrades; rebuild compatible data and repeat relevant checks. See the manual index and API reference.