Shapes with DoTween

Avatar
  • updated

I am using DoTween and I wanted to use Shapes with it. For example, I am using Torus from Shapes and I want to fade out the color of it. But looks like DoTween cannot find a material to fade the color?

http://dotween.demigiant.com/documentation.php

A small example of what I am trying to achieve:

using Shapes;

public class Example: MonoBehaviour { 

public Torus torus;

public void Start(){

    torus.DOColor(new Color32(255, 255, 255, 0), 2.0f); // Throws error

}

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Other
Avatar
Freya Holmér creator

DOTween doesn't know what property to change, so it only works with objects it has explicitly implemented support for, and it doesn't have explicit support shapes. 


But you can use the generic tweener like this:

DOTween.To( torus.Color, c => torus.Color = c, Color.white, 2f );
Avatar
saif
Quote from Freya Holmér

DOTween doesn't know what property to change, so it only works with objects it has explicitly implemented support for, and it doesn't have explicit support shapes. 


But you can use the generic tweener like this:

DOTween.To( torus.Color, c => torus.Color = c, Color.white, 2f );

Thank you! Yup I will use generic DoTween for this case. 
Will there be a support in future you reckon? 

Avatar
Freya Holmér creator

I don't have any plans on adding support myself in shapes, and I don't know if daniele does in DOTween either! but I'm guessing it's not that hard to add your own for the cases you need

Avatar
saif
Quote from Freya Holmér

I don't have any plans on adding support myself in shapes, and I don't know if daniele does in DOTween either! but I'm guessing it's not that hard to add your own for the cases you need

Yup will do that :)

Also one other thing, from your solution, I get this error:

Cannot implicitly convert type 'ulong' to 'UnityEngine.Color'

How do I fix this?

Avatar
Freya Holmér creator
Quote from saif

Yup will do that :)

Also one other thing, from your solution, I get this error:

Cannot implicitly convert type 'ulong' to 'UnityEngine.Color'

How do I fix this?

not sure! I'm guessing the method call signature doesn't match DOTweens somehow, I'd double check that