Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - vi54

Pages: [1]
DOTween & DOTween Pro / can't tween value on script
« on: February 01, 2016, 09:46:10 PM »

I have a camera FX script with a few public variables.
I call these from a different gameObject, and make a (working) connection as I can enable / disable the component. Thus knowing it has a good reference.

However. When I try to tween the float value 'intensity" on the script it does not tween.
other tweens in the same script does work.
for example a text tween: GM.ScoreText.DOText ("Score_" + GM.currentScore, 2f, false, ScrambleMode.None, null);

This tween however does not work.
Code: [Select]

WaterEffectScript WaterFX;
void Start(){
  WaterFX.enabled = false;
  WaterFX.Intensity = 0.66f;
  WaterFX = Camera.main.GetComponent<WaterEffectScript>();

public void OnTriggerEnter2D(Collider2D other){
 if (other.gameObject.tag == "Player") {
   WaterFX.enable = true; //works
   GM.ScoreText.DOText ("Score_" + GM.currentScore, 2f, false, ScrambleMode.None, null);//works
   DOTween.To (() => WaterFX.Intensity, x => WaterFX.Intensity = x, 0,2f).OnComplete(DisableFX); //doesn't tween

Thanks for your insight.

Pages: [1]