Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting instances of rope mesh renderer at runtime
#2
Managed to fix it like this: any time I need to change instances amount, I wait till Initialization in UniTask
Code:
    async UniTaskVoid SetInstances(int parts)
    {
        await UniTask.Yield(PlayerLoopTiming.Initialization, this.GetCancellationTokenOnDestroy());
        meshRend.Instances = parts;
    }

I tried to set instances in LateUpdate() with no luck. Anyway, I use Unitask in this project.
Reply


Messages In This Thread
RE: Setting instances of rope mesh renderer at runtime - by luvjungle - 30-05-2021, 12:12 PM