Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - tcmeric

Pages: 1 ... 48 49 [50]
VR Help / Re: Camera Fade Out / Fade In works but not in VR (Vive) Help!
« on: February 20, 2017, 09:44:20 PM »
PS, if you just want a fade to black.

Make a black cube. Make it the child of the eye in the VR rig. Set its location to 0,0,0 and it will be right on your head. Deactivate it and set the alpha to 0 until its needed.

Use playmaker to activate the object when you are ready. Use playmaker to lerp an int on the alpha channel of the black object till it reaches 100. (The screen will be black).

Put the FSM directly on the cube to make it easy. Duplicate cube as necessary and put it over all necessary cameras.

VR Help / Re: Camera Fade Out / Fade In works but not in VR (Vive) Help!
« on: February 20, 2017, 09:41:20 PM »
You can use an asset like Beautify. It is 35$, but it does work with single pass rendering and I have personally tested it with steam VR. Its performance hit is fairly low (depending on which filter you are using). It also seems to not have any issues with the lab renderer. It has vignette with various options that can be set and changed during run time.

Put the script on the main camera eye of the VR rig. Create a new FSM on an object. Create a new state. Drag and drop the script FROM the main camera eye (not from the project browser), onto the state (where you normally have all your actions setup). You will then get a get/set option for the script. Choose set. Look for vignette. Set the bool to true or false as necessary to turn on and off the vignette.

Create a mask for the vignette (has one by default but you can change it from the inspector easy). Turn up and down the alpha of the black color to make it cover more and more of the screen and eventually fade completely to black.

I also use playmaker to disable the script when not in use to save resources.

As for the playmaker action to use over time. You could create a look with a wait state. Ie, -5 alpha, wait .1 seconds, repeat. Then do a int check to see when it reaches -100 and finish. Or look into a int lerp or float lerp.!/content/61730

PlayMaker Help / Support for FsmUshort [Solved]
« on: February 20, 2017, 12:22:32 PM »

Is there any support for FsmUshort in custom actions? I am having some trouble converting a float to ushort and back  :'(


PlayMaker Help / Re: Custom Action Assistance - Audio Clip
« on: February 20, 2017, 08:27:01 AM »
Thank you!

While I have you here, do you have any examples or know how to get a Enum into a FsmEnum in a custom action? I have looked around to find some examples on the net, but havent seemed to be able to find one.

PlayMaker Help / Custom Action Assistance - Audio Clip[SOLVED]
« on: February 20, 2017, 03:40:17 AM »
I am trying to set an audio clip with a custom action. Seems like I am not having much luck.

I am getting the following error: Assets/VRWeapon_Playmaker/WeaponShotAudioAction.cs(72,35): error CS0266: Cannot implicitly convert type `UnityEngine.Object' to `UnityEngine.AudioClip'. An explicit conversion exists (are you missing a cast?)

The orginal script sets the variable as AudioClip
public AudioClip shotSound;

In playmaker, I set my Var as

public FsmObject gunSound;

But that doesnt seem to work.


My Full Custom Action

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
   [Tooltip("Adjust the shot sound for VRweapons script on an object")]

   // the class must match the name of the action
   // if the action is named missleAction then that should be the name of the class
   public class WeaponShotAudioAction : FsmStateAction
      // add the name of your script inside of typeof("yourScriptName"))

      // this is the game object the script is on
      public FsmOwnerDefault gameObject;

      [Tooltip("Set audio shot sound.")]
      // add the variables you want in your action
      public FsmObject gunSound;

      // you can usually leave this alone
      public FsmBool everyFrame;

      // you are making a custom variable with the scripts type
      Weapon theScript;

      public override void Reset()
         //its good practice to set your var to null at start
         gameObject = null;
         gunSound = null;
         everyFrame = false;

      public override void OnEnter()
         var go = Fsm.GetOwnerDefaultTarget(gameObject);

         // you are grabbing the script from the game object and storing it in your custom variable type
         theScript = go.GetComponent<Weapon>();

         if (!everyFrame.Value)


      public override void OnUpdate()
         if (everyFrame.Value)

      //Name your method here
      void DoTheMagic()
         var go = Fsm.GetOwnerDefaultTarget(gameObject);
         if (go == null)

         //Playmaker variable to Script

         theScript.shotSound = gunSound.Value;

         //Note! Playmaker var's need .Value after them or they won't work in some cases



PlayMaker Help / Get Object Rotations Over 360
« on: February 18, 2017, 07:48:36 AM »
I am trying to get rotations (every frame) over 360. The inspector says over 360 (for example 450, not back to 90 degrees again). However, in playmaker, using the "get rotation" action or the "Get Property" from the object, it also goes from 360 back to 0 in rotation.

Since I am doing some simple math equations on the rotational Y angle, I need the inspector number. Any way to get this with playmaker?

PlayMaker Help / Re: UnityEvent to Playmaker
« on: February 12, 2017, 11:19:05 PM »
Thanks for the tip. Ill give it a try. I am taking 2 of your courses right now. Behavior designer and playmaker.

PlayMaker Help / UnityEvent to Playmaker[SOLVED]
« on: February 11, 2017, 10:51:39 PM »

Maybe I am missing something obvious. I have a script on an object that has a UnityEvent, that can be changed in the inspector. I would like those events to send a event to playmaker. I havent been able to find an answer to this by searching, but I am sure it has come up again.

You can see the script called "Health Manager". I would like it to fire a playmaker event for example when On Damage () occurs.

Any advice? Thank you!

Pages: 1 ... 48 49 [50]