Edited: New version now has a "recursive" option, which allows you to set all children objects of the selected Game Object visible/invisible as well.This is one of those actions which, before I decided to make, I've scratched my head and thought to myself: "wait, there
must be something like this already in Playmaker, I'm just being blind!". Well, aside from disabling the whole object (which might not be what you want) or trying to disable the component (and btw meshrenderer isn't listed), only thing I found was blink. Which is not only not very straightforward for casual visibility toggling usage but, to be frank, I never found a way to disable once turned on heh

Just to be on the safe side that I wasn't going to be redundant, I've added some nice functionality to this action:
1 - Visible: Basic on/off toggle, can be set to a boolean variable.
2 - Toggle: If you set "toggle" the action will reverse the assigned gameobject visibility. This setting overrides the 'visible' setting.
3 - Reset On Exit: Reverts the visibility to the original visibility of the moment the state was entered.
BTW, the
Reset On Exit option gave me some headache, it wasn't as obvious to code in as I initially thought it'd be. Anyways, it's working fine and it's a big help if you're trying to make one object visible or invisible just throughout the duration of a state.
Well, there you go, hope it's of help to you guys!
PS.: To install it just create a new c# script inside your project, preferrably inside Assets/playmaker/actions, rename it to 'SetVisibility' (without the quotes), double click to open it and paste the attached code.
PS/2: Hey, we've got a better 'code' font here in the forum! Great

using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Material)]
[Tooltip("Sets or toggle the visibility on a game object.")]
public class SetVisibility : FsmStateAction
{
[RequiredField]
//[CheckForComponent(typeof(Renderer))]
public FsmOwnerDefault gameObject;
//[UIHint(UIHint.Variable)]
[Tooltip("Should the object visibility be toggled?\nHas priority over the 'visible' setting")]
public FsmBool toggle;
//[UIHint(UIHint.Variable)]
[Tooltip("Should the object be set to visible or invisible?")]
public FsmBool visible;
[Tooltip("Resets to the initial visibility once\nit leaves the state")]
public bool resetOnExit;
public bool recursive;
private bool initialVisibility;
public override void Reset()
{
gameObject = null;
toggle = false;
visible = false;
resetOnExit = true;
initialVisibility = false;
recursive = true;
}
public override void OnEnter()
{
if (gameObject.OwnerOption == OwnerDefaultOption.UseOwner)
DoSetVisibility(Owner);
else
DoSetVisibility(gameObject.GameObject.Value);
Finish();
}
void DoSetVisibility(GameObject go)
{
if (go == null) return;
var renderers = go.GetComponentsInChildren<Renderer>();
// 'memorizes' initial visibility
bool isRootRenderer = (go.GetComponent<Renderer>() != null);
if (isRootRenderer)
initialVisibility = go.renderer.isVisible;
else
initialVisibility = false;
// if 'toggle' is not set, simply sets visibility to new value
if (toggle.Value == false) {
if (isRootRenderer)
go.renderer.enabled = visible.Value;
if (!recursive) return;
foreach (var renderer in renderers) {
renderer.enabled = visible.Value;
}
return;
}
// otherwise, toggles the visibility
if (isRootRenderer)
go.renderer.enabled = !go.renderer.isVisible;
if (!recursive) return;
foreach (var renderer in renderers) {
renderer.enabled = visible.Value;
}
return;
}
public override void OnExit()
{
if (resetOnExit)
ResetVisibility();
}
void ResetVisibility()
{
// uses the FSM to get the target object and resets its visibility
GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
if (go != null && go.renderer != null)
go.renderer.enabled = initialVisibility;
}
}
}