Dotween: DOFade not working on CanvasGroup

Created on 30 Sep 2017  路  15Comments  路  Source: Demigiant/dotween

When I try using

GetComponent<CanvasGroup>().DOFade(1.0, 1.0);

I get the following error:

UnityEngine.CanvasGroup' does not contain a memberDOFade`

Using DOTween 0.9.690

Most helpful comment

Hi,

It seems you didn't run DOTween's setup, because you're missing the DOTween46.dll. You can find it under "Tools > Demigiant > DOTween Utility Panel".

Cheers,
Daniele

All 15 comments

Hi,

It seems you didn't run DOTween's setup, because you're missing the DOTween46.dll. You can find it under "Tools > Demigiant > DOTween Utility Panel".

Cheers,
Daniele

Have seen your answer somewhere else and redone the setup multiple times (force setup) without getting rid of the problem.

Now I've tried a brand new project with just DOTween and still the same problem.

The full error message:

Assets/dotweenManager.cs(11,34): error CS1929: Type UnityEngine.CanvasGroup does not contain a member DOFade and the best extension method overload DG.Tweening.ShortcutExtensions43.DOFade(this UnityEngine.SpriteRenderer, float, float) requires an instance of type UnityEngine.SpriteRenderer

First time setup shows this weird message:

DOTween is now setup, two extra files were removed

Unity 5.6.3f1
DOTween 0.9.690

The setup message is correct, if as I assume you're using the Pro and don't have 2D Toolkit and TextMesh Pro installed (in which case the relative files for those are removed).

That said, this is very weird. Can you check your DOTween folder and see if you have 2 files named DOTween46? Also, can you confirm you're using the Pro?

Managed to solve the problem suddenly after a Unity restart.
Thanks for your support.

Crazy Unity :O But glad you solved it!

It seems you didn't run DOTween's setup, because you're missing the DOTween46.dll. You can find it under "Tools > Demigiant > DOTween Utility Panel".

Regards,

I am seeing this issue. Restart didn't help.

https://issuetracker.unity3d.com/issues/image-color-cannot-be-changed-via-script-when-image-type-is-set-to-simple it might be this issue that unity has right now i recently also ran into an issue like this but im positive not it is not dotween but this unity bug that is causing the issue

@Demigiant
I'm not sure, but the UI-related functionality doesn't work on 2020.1
DoTween.To(Color, Color, float, float), DoTween.ToAlpha(), image.DoFade(float, float), image.DoColor(...), text.DoFade and text.DoColor. There are no errors. The alpha value just doesn't change.
Is this a known problem, or is it just for me?

For now, I use the built-in .CrossFadeAlpha() function. Works as it should.

Ahoy,

I just installed 2020.1.0a and DOFade works correctly both on Image and CanvasGroup. Are you sure there's not something else happening?

@fax1ty
I just got the same problem on Unity 2020.1. I manage to fix it by adding asmdef files to DoTween and then referencing them in my own asmdef.

I had the same problem on Unity 2019.4.5f1, I solved by updating Visual Studio Code Editor Package to version 1.2.3

Got the same error on my side with Unity 2020.2.7f1. Everything else work fine, but just cannot add a DOFade to a canvas group.

Got the same error with Unity 2021.1.3f1

Got the same error, in our case was due to using Assembly Definitions in our project and not referencing DOTween's Assemblies as dependencies. The discussion on this issue gave me the answer: #264

We missed them because they are not generated by default; to generate DOTween's Assembly Definitions, open the DOTween Control Panel (_Tools/Demigiant/DOTween Utility Panel_) and in the _Setup_ tab, press the _Create ASMDEF_ button.
image

Now you can reference both _DOTweenPro.Scripts.asmdef_ and _DOTween.Modules.asmdef_ to your Assembly Definitions :)
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leeprobert picture leeprobert  路  5Comments

lucasmontec picture lucasmontec  路  6Comments

ceyhuntasci picture ceyhuntasci  路  5Comments

Dentrax picture Dentrax  路  10Comments

RDeluxe picture RDeluxe  路  8Comments