Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Animating a shape on along a spline will not playback in scene or game views
#3
(05-01-2023, 11:16 AM)_Aka_ Wrote: Hi

TL;DR:
Add this script to your module:
Code:
using FluffyUnderware.Curvy.Generator;
using UnityEngine;

public class Dirtier : MonoBehaviour
{
    void Update() =>
        GetComponent<CGModule>().Dirty = true;
}



The issue is that the animator seems to not call Unity's OnValidate when changing the value of a property. OnValidate is where the module gets dirty, meaning that the module is marked as needing to trigger a refresh of the generator. So no OnValidate -> no dirtying -> no refreshing.
The script provided will artificially dirty the module at every update. Disable the script if you are not animating the module, since that will lead to unnecessary updates generator.
You can use a similar that will dirty the whole generator (CurvyGenerator.Dirty) instead of a single module.

Did this help?
If and when you feel like it, please leave a review for the asset, that helps a lot
Have a nice day

This worked, can't believe I was thinking along the same lines as what the solution was but didn't know how to call .dirty(). In my mind I knew that it would have been a refereshing issue. Thanks again.
Reply


Messages In This Thread
RE: Animating a shape on along a spline will not playback in scene or game views - by sam_bond - 05-02-2023, 09:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best way to duplicate a spline with an offset Kapistijn 8 1,353 04-12-2026, 03:18 PM
Last Post: _Aka_
Smile Constant speed along a spline? tfishell 1 654 11-13-2025, 11:32 AM
Last Post: _Aka_
  Create Game Object Renaming Options rickgplus 1 934 09-23-2025, 09:33 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 4,452 07-29-2025, 09:15 PM
Last Post: _Aka_

Forum Jump: