Dotween v2 How to do a DOVirtual.Color

1.7k Views Asked by At

I have been trying to make a RGB effect with a color using DOTween, i have research about DOVirtual.Color but i havent found anything i got the 3 first parameters, but what means "TweenCallback onVirtualUpdate" ?? Image of the function

I have try to put some values to update while is in runtime the tween or a function tu get a color parameter but nothing had succes

1

There are 1 best solutions below

0
On

The duration of the tween can be several frames. The callback onVirtualUpdate is a function that will be called every frame and contains the current color.

using DG.Tweening;
using UnityEngine;

public class ColorChanger : MonoBehaviour
{
    [SerializeField] private MeshRenderer meshRenderer;

    private void Awake()
    {
        DOVirtual.Color(Color.black, Color.white, 10, (value) =>
        {
            meshRenderer.material.color = value;
        });
    }
}