Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: blazingriver on August 06, 2014, 02:10:42 PM
-
Hi,
I want to fade a gameobject (a 2dtoolkit sprite to be specific) in and then out. I don't believe that there is such an action in playmaker. I found this action which seems to achieve what I want though: http://hutonggames.com/playmakerforum/index.php?topic=1777.0 (http://hutonggames.com/playmakerforum/index.php?topic=1777.0), but I am not quite sure how to use it! :P
If someone could guide me through the process of making a simple FSM with this or a similar action to fade in and out a sprite that would be great! (a 2dtk sprite preferably but I don't think that it would make a difference).
Thanks
-
You also have a Camera Fade In and Camera Fade Out actions... Both actions only requiere a time value and have a finishing event.
-
Have you tried the Sprite Set Color action in the 2D Toolkit actions:
https://hutonggames.fogbugz.com/?W717
Use the alpha component of the color to control transparency.
Use Ease Color (or another tweening action) to change the color over time:
https://hutonggames.fogbugz.com/default.asp?W566
-
Hi,
Thanks for your reply. When I use the ease color or the sprite set color action nothing happens. I know that I am doing something wrong, but I'm not quite sure what! How would you accomplish a fade in/out with the sprite set color actions or the ease color actions (also would you use both or only one)? Obviously my method isn't working!
I am also getting this error when I try to run it:
OpenGL Context became invalid during rendering
Thanks
-
Hi,
What shader do you have on your sprite material? and what platform do you target?
Your errores happens in Unity or at runtime?
Bye,
Jean
-
The sprite material uses the default tk2d/"BlendVertexColor" shader. I also get this error
NullReferenceException: (null)
UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs)
UnityEditor.Editor.GetSerializedObjectInternal ()
UnityEditor.Editor.get_serializedObject ()
UnityEditor.MaterialEditor.OnEnable ()
However, this hasn't seemed to cause any issues for me and I think that it is a tk2d error. I am targeting the iOS platforms and, if I remember correctly, the error occurs at runtime. It may just not work since I have set up my FSM incorrectly, but I still can't figure out the correct way to get the FSM to work.
Any help on this would be appreciated :)
Thanks!
-
Bump
-
I've never worked with a 2dtk object but why not use the animator component? Create a new animation on the object you wish to fade out and use keyframes to change the value of the alpha from 255 to 0.
-
I hadn't actually considered that before. I have never actually ended up using the animator in 2dtk. However, I have seen on some topics such as this: http://2dtoolkit.com/forum/index.php?topic=1604.0 that it is much more complicated since you cannot animate properties, and I have little coding experience which is why I would prefer to do it through playmaker. Also, when I try to change the shader it always reverts back to the default tk2d/blendvertexshader.
-
Thanks! That works perfectly for my purpose!
Have you tried the Sprite Set Color action in the 2D Toolkit actions:
https://hutonggames.fogbugz.com/?W717
Use the alpha component of the color to control transparency.
Use Ease Color (or another tweening action) to change the color over time:
https://hutonggames.fogbugz.com/default.asp?W566