playMaker

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 ... 30 31 [32]
466
Share New Actions / Re: VRWeapons Actions for SteamVR Weapons
« on: February 21, 2017, 05:15:12 AM »
Oh, and here is the link to the asset. It is top notch. IMHO the best VR weapons package out there at the moment (and the only one with playmaker actions  8) )

https://www.assetstore.unity3d.com/en/#!/content/66387

467
Share New Actions / VRWeapons Actions for SteamVR Weapons
« on: February 21, 2017, 05:13:26 AM »
I have created a set of playmaker actions for the VRweapons asset on the unity store. I am not the creator of this assets package, but I do use it myself. So, I decided to create some actions for it.

You can download it for free here on Github. This works with VRweapons version 1.18. A new version is expected soon. I am working with the asset creator to update the actions to the newest version when it comes out on the unity store. My playmaker actions for the newest version will become available on the unity store (free) and also on github.

Enjoy and please feel free to leave any comments, questions or concerns below.

https://github.com/dumbgamedev/VRweapons_Playmaker

468
Playmaker Help / Re: Support for FsmUshort
« on: February 21, 2017, 04:50:37 AM »
Hi,

Thank you for the reply. I am basically just setting up a custom action which sets playmaker FsmVariables to script variables. It is for the VRweapons package on the asset store that allows quick building of weapons for steam VR. The playmaker actions will be release for free (I am not the author of the asset but have their permission).

In the Weapons.cs script, it is written this way:
Quote
[Range(0, 0.2f)]
public float bulletSpreadRange;
public float kickStrength;
public float rotKickStrength;
public ushort hapticStrength;
etc etc.

My script is basically the template from MdotStrange, which works otherwise. I was hoping I could dump the ushort into a float. I have never done a variable type conversion. I have done some reading up on it, but havent figured it out yet.

Quote

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
   [ActionCategory("VRweapons")]
   [Tooltip("Adjust weapon haptic time per shot in frames 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  WeaponHapticAction : FsmStateAction
   {
      [RequiredField]
      // add the name of your script inside of typeof("yourScriptName"))
      [CheckForComponent(typeof(Weapon))]   

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

      [Tooltip("Adjust weapon haptic time per shot in frames.")]
      // add the variables you want in your action
      public FsmFloat HapticStre;

      // 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;
         HapticStre = 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)
         {
            MakeItSo();
            Finish();
         }

      }

      public override void OnUpdate()
      {
         if (everyFrame.Value)
         {
            MakeItSo();
         }
      }

      //Name your method here
      void MakeItSo()
      {
         var go = Fsm.GetOwnerDefaultTarget(gameObject);
         if (go == null)
         {
            return;
         }

         //Playmaker variable to Script

         theScript.hapticStrength = HapticStre.Value;

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


      }

   }
}


Also can I ask, is there any way to get variables from serialized fields from a script into playmaker? I tried the same script above (changed for floats), but i get an error about them being read only.

Script.cs

Quote
   [SerializeField]
   float maxHealth = 100f;
   [SerializeField]
   float currentHealth;

469
Playmaker Help / Re: Custom Action Assistance - Audio Clip
« on: February 20, 2017, 11:53:01 PM »
Thanks, I appreciate the assistance. I think I am going to go back and re-watch some parts of a C# course I am taking first. I am hoping that will help to clarify some things for me. I am fairly new to C#.

Ill post back here later once I have done so.

470
Share New Actions / Re: Google Daydream Actions
« on: February 20, 2017, 10:08:29 PM »
Nice, good job!  8)

471
Share New Actions / VRTK Actions
« on: February 20, 2017, 10:08:01 PM »
I have started creating actions for VRTK. It is a bit of a challenge for me at my skill level, but i am working away at it. Also, VRTK changes pretty fast (on their github). The current store asset version is 3.0.1, and the current github version have some pretty significant changes. The github version will be pushed to the asset store fairly soon Ive been told. So I have now started working on the github version instead of the asset store version.

I have been in touch with the VRTK creator, theStoneFox, and they are pretty hands-off, as they are not familiar with playmaker. Therefore I hope this forum doesn't mind me bothering you all sometimes for custom action help as I come across new problems. Thanks to MdotStrange for getting me started with his template for custom actions.

All that being said, actions are free to download from my github account here: https://github.com/dumbgamedev/

My plan is to work first on pointers, then teleporters/locomotion, followed by input methods. We will see how that goes.

It is a HUGE toolkit, so there potentially could be a TON of actions from it. It likely will change again before I even get to the end. So if people have requests, better post them here, so I can bump them up on my to-do list.

472
VR Help / Re: What do we need to do to get VR Toolkit integration?
« on: February 20, 2017, 09:59:49 PM »
Seems like not many replies to this, but ill put it out there. I have started the process. I have been in touch with theStoneFox. They are pretty hands off about it, as they don't know anything about playmaker. That being said, I started creating actions for VRTK.

The issue is VRTK changes ALOT, and therefore actions can break pretty fast. Their github version vs the asset store version is not usually the same.

Here is my github which i just started. Hopefully over the next few weeks it should get more actions. I am doing the pointers first. https://github.com/dumbgamedev

473
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.

474
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.

https://www.assetstore.unity3d.com/en/#!/content/61730

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

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

Thanks.

476
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.

477
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

[ObjectType(typeof(AudioClip))]
public FsmObject gunSound;


But that doesnt seem to work.


------

My Full Custom Action

Quote
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
   [ActionCategory("VRweapons")]
   [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
   {
      [RequiredField]
      // add the name of your script inside of typeof("yourScriptName"))
      [CheckForComponent(typeof(Weapon))]   

      // 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
      [ObjectType(typeof(AudioClip))]
      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)
         {
            DoTheMagic();
            Finish();
         }

      }

      public override void OnUpdate()
      {
         if (everyFrame.Value)
         {
            DoTheMagic();
         }
      }

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

         //Playmaker variable to Script

         theScript.shotSound = gunSound.Value;

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


      }

   }
}

478
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?

479
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.

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

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 ... 30 31 [32]