Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: colpolstudios on April 22, 2021, 02:19:26 AM

Title: Dissolve shader playmaker [Solved]
Post by: colpolstudios 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 (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);
    }
}
Title: Re: Dissolve shader playmaker
Post by: djaydino 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 (https://hutonggames.fogbugz.com/default.asp?W1181)) this will change only the material instance on the target object.

to 'animate' the dissolve you can use 'Tween Float'
Title: Re: Dissolve shader playmaker
Post by: colpolstudios 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.

Title: Re: Dissolve shader playmaker
Post by: djaydino 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 :)
Title: Re: Dissolve shader playmaker [Solved]
Post by: colpolstudios 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 (https://ibb.co/gyxvy8q)
Title: Re: Dissolve shader playmaker
Post by: colpolstudios 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?

Title: Re: Dissolve shader playmaker
Post by: djaydino 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