Manual Update

Where to toggle

Edit → Project Settings → VAT Settings → Manual Update

This adds or removes the scripting define NL_VAT_MANUAL_UPDATE on every build target group. Changing the toggle recompiles scripts.

Default: off (Unity drives updates).

When to enable

Enable Manual Update when you need full control over animation stepping — for example in an online / networked project, or whenever playback must run at a specific point in your frame.

Leave it off when Unity Update / LateUpdate is enough.

What changes at compile time

Component Manual Update off Manual Update on
VertexAnimPlayer Update calls Tick(Time.deltaTime) Call VertexAnimPlayer.Tick(deltaTime) yourself
VertexAnimLocomotionDriver Update calls Tick() Call VertexAnimLocomotionDriver.Tick() yourself
InstancedRenderSystem LateUpdate calls LateTick() Call InstancedRenderSystem.LateTick() yourself

Public Tick / LateTick methods always exist so hosts can drive playback explicitly.

Host tick loop

Order matters: locomotion writes → player advances → instanced draw.

C#
using NOT_Lonely.VertexAnimator.Runtime;
using UnityEngine;

public class VatManualHost : MonoBehaviour
{
    [SerializeField] VertexAnimLocomotionDriver[] drivers;
    [SerializeField] VertexAnimPlayer[] players;

    void Update()
    {
#if NL_VAT_MANUAL_UPDATE
        var dt = Time.deltaTime;

        for (int i = 0; i < drivers.Length; i++)
        {
            if (drivers[i] != null)
                drivers[i].Tick();
        }

        for (int i = 0; i < players.Length; i++)
        {
            if (players[i] != null)
                players[i].Tick(dt);
        }

        if (InstancedRenderSystem.TryGetExisting(out var system))
            system.LateTick();
        // Or: InstancedRenderSystem.Instance.LateTick();
#endif
    }
}

For large crowds, tick from your existing simulation loop (not necessarily a MonoBehaviour Update) — same call order.

Avoid double-ticking

If Manual Update is off, do not call Tick / LateTick from your own loop to prevent double-ticking.

Guard optional host code with the define:

C#
#if NL_VAT_MANUAL_UPDATE
    player.Tick(deltaTime);
#endif

Edit Mode

Even with Manual Update on, the player still runs a small Edit Mode Update path so authoring previews (for example Custom Data) can refresh without Play Mode.