Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started 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);
}
}
-
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'
-
thankyou djaydino, can you recommend the correct values used in the tween float.
I have never used that before.
-
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 :)
-
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)
-
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?
-
HI.
The dissolve should be fine if the shader is set for mobile,
best is to make a build to test