playMaker

Author Topic: Dissolve shader playmaker [Solved]  (Read 1268 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Dissolve shader playmaker [Solved]
« on: April 22, 2021, 02:19:26 AM »
Hi, just found this cool free asset: https://assetstore.unity.com/packages/vfx/shaders/simple-dissolve-shader-123865

It comes with a demo scene and includes the script below.

My coding skills are extremely poor and wish to use the effect to dissolve an object, but using playmaker.

When you play the demo scene the sphere dissolves and then the effect seems to be reversed. I only want it to dissolve, Can someone help?


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DissolveSphere : MonoBehaviour {

    Material mat;

    private void Start() {
        mat = GetComponent<Renderer>().material;
    }

    private void Update() {
        mat.SetFloat("_DissolveAmount", Mathf.Sin(Time.time) / 2 + 0.5f);
    }
}
« Last Edit: May 08, 2021, 03:25:02 PM by colpolstudios »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Dissolve shader playmaker
« Reply #1 on: April 22, 2021, 07:35:06 AM »
Hi.

you can use:

"Set Material Float" this will change for all objects that use this material
or
"Set Material Property Block Float" (Ecosystem) this will change only the material instance on the target object.

to 'animate' the dissolve you can use 'Tween Float'

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: Dissolve shader playmaker
« Reply #2 on: April 22, 2021, 12:49:15 PM »
thankyou djaydino, can you recommend the correct values used in the tween float.

I have never used that before.


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Dissolve shader playmaker
« Reply #3 on: April 22, 2021, 06:16:45 PM »
Hi.
It depends on what you want.

You can get the current value and use that as starting value.
and set an end value

or you can use fix start/end values.

time is the duration for the tween.

Best is To play around with it on a new scene :)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: Dissolve shader playmaker [Solved]
« Reply #4 on: April 23, 2021, 04:25:35 PM »
Thank you so much for your very kind help.

Thought I would offer some information on my use.

https://ibb.co/gyxvy8q

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: Dissolve shader playmaker
« Reply #5 on: April 23, 2021, 06:46:00 PM »
Possibly not the correct place to ask this question, but are there any issues using this dissolve feature on a sprite on a mobile device?


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Dissolve shader playmaker
« Reply #6 on: April 23, 2021, 07:12:54 PM »
HI.
The dissolve should be fine if the shader is set for mobile,
best is to make a build to test