Playmaker Forum

Playmaker Help & Tips => VR Help => Topic started by: sebaslive on August 01, 2016, 02:26:13 PM

Title: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on August 01, 2016, 02:26:13 PM
To differentiate from the news and updates section, if you need any help on the asset or have any questions please ask here. Others can possibly benefit from the help as well.

Video installing steam vr playmaker toolkit.


Thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: shinestrength on August 14, 2016, 10:58:58 PM
Heya, just got your asset.

The example file seems broken in the latest version of Playmaker - all blank FSMs. Any idea as to what I might be missing/doing wrong?

The teleportation example file works fine.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on August 15, 2016, 05:50:38 AM
Hi Shinestrength!

There seems to have been an issue when the asset was uploaded to unity. The example scene became corrupted on transfer. There is a version that is currently being processed by unity staff as of this moment but I have sent you an immediate fix to your personal messages.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: shinestrength on August 15, 2016, 07:20:46 PM
Thanks, works perfectly.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: emilianojsaiz on August 18, 2016, 06:42:37 AM
What is the difference between?

Steam VR Playmaker Toolkit
https://www.assetstore.unity3d.com/en/#!/content/63425 (https://www.assetstore.unity3d.com/en/#!/content/63425)

and

Steam VR tools for Playmaker
https://www.assetstore.unity3d.com/en/#!/content/60854 (https://www.assetstore.unity3d.com/en/#!/content/60854)

Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on August 18, 2016, 06:58:03 AM
Hi Emilianojsaiz,

I can't speak for the plans of the other creator, but my toolkit is meant for getting you started quickly with Vive and playmaker offering examples and scenes that are basic to every Vive game. There are also planned updates for the package and I am always open to the communities suggestions and what they would like to see implemented into the package. You can also see the documentation so you know exactly what is offered on my website. http://media.wix.com/ugd/fc88c8_61f0fdbfcf68457d8f799ff638d5bb2b.pdf (http://media.wix.com/ugd/fc88c8_61f0fdbfcf68457d8f799ff638d5bb2b.pdf)

I hope this information helps!

 
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on August 18, 2016, 01:03:37 PM
Looking forward to the Bow and Arrow update

Personally i'd like a physics based pickup system where the object is never parented to the controller, so that the player can interact with physics objects, pick them up and use them without the physics system freaking out.
Something like the NewtonVR system but created in playmaker.

That way people using your asset can just drag and drop a fully usable interaction system into a scene and pickup anything they want within seconds.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on August 18, 2016, 01:33:18 PM
Bow and Arrow is the next big update for this month! I'll look into NewtonVR but from what I played around with the grabbing objects, the physics were a bit unstable or had a slight delay that seemed unrealistic in movement. I will still look into it since i'm sure it could be used for multiple reasons.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: shinestrength on August 22, 2016, 05:25:04 PM
Any chance of a grab/throwing example scene?

RN I'm using a fixed joint that gets destroyed on releasing the grip, but for some reason the inertia of the throw is not being passed on, and the object stops in mid air. Tried AddForce/Torque, Set Velocity/AngularVelocity after getting the controllers velocity and angular velocity, but no luck so far. Wondering if it's something to do with the execution order.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on August 22, 2016, 07:42:51 PM
Hey Shinestrength, in the example scene there is a ball(sphere) next to the guns on the table. This is the grab and throw that uses velocity and angular velocity. You can inspect the playmaker fsm of the ball to see how to achieve this as well!

You can also reset the ball back into the position with the grip buttons i believe.

Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on August 27, 2016, 10:33:36 PM
Hey LordHorusNL,

The bow and arrow update is currently being processed and will be in the next update!

(http://i.imgur.com/ueQbRRa.gif)

Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on September 01, 2016, 06:50:48 AM
Great work sebaslive, i tried the update and i'm amazed that you could pull this off with just playmaker. Did not think something this complex could be done ;)

The only thing i did not like, was the fact that when you pull the string, you get constant heavy haptic feedback, instead of a slowly build up. but i'm guessing that's just not possible with the current actions.

Anyway great update man 
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on September 01, 2016, 07:01:27 AM
Hey LordHorusNL,

It is possible, one option would be to see how the arrow gets launched based by distance. You get those same values and set those into the haptic feedback and compare to see how heavy the feedback should be. Another option is to only give feedback when it is pulled by getting the numbers on distance, comparing it to itself and if greater than, set feedback (similar to Longbow).

I left it open for any developer to choose their option but (I hope) with enough information in different areas to see how it can be done in your own way. All the FSMs are also commented out to allow customization and understanding to each state and action. The purpose being, if you like the bow and arrow with its current set up, you can use it right away, and if you want to tweak it, that's easy to do as well! If you have any questions on it, please let me know.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: ToxicFrog on September 03, 2016, 10:11:37 AM
Hi everyone!

I'm making a car experience, and am having a bit of trouble.

When the scene begins, the [CameraRig] is made a child of the car, so that the camera stays in its 'seat'. That works fine.

However, when the game begins, I need the [CameraRig] to always orient so that it's looking forward, toward the front of the car. Right now, when the game begins, if I'm facing my computer, it works as intended. However, if I start the game looking in any other direction, the [CameraRig] does not point toward the front of the car.

How can I set the [CameraRig] to look toward the front of the car when the game begins?

I hope this makes sense. Basically, I need the camera to look toward the front of the car, regardless of which direction the player is facing in the real world when the game begins.

Thanks for any help!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on September 03, 2016, 03:39:03 PM
Hey Toxicfrog!

I sent you an email recently with some possible solutions. I would try the look at action or at rotation. You can reply here or in the email. Thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: j0hnbane on September 04, 2016, 11:38:53 AM
Hello Sebas,

I put a post up in your Unity3d forum post, but I figured I'd ask here as well.

Is their a way to tie the controller events of like 'trigger pressed' bool In your addon to the unity input controls? Like Fire1 or what not?

Thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on September 04, 2016, 02:54:07 PM
Hi John!

Currently there is no way that I know of to to mix the input manager with the controller. I believe that steam made a response to this for a future update. but to be clear, you would like a bool to trigger when an action is done?
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: j0hnbane on September 04, 2016, 04:24:01 PM
First off, thank you for replying. It is much appreciated.

Here is my actual situation.

I've got some great RPG frameworks and inventory systems I'd like to use for a VR game. The only problem is a lot of them are dependent on the input from Unity. As of now, doesn't have anything to reference actions done on a controller.

With ORK Framework, Gil has it set up to allow custom controllers. But it requires I reference the behavior name/script name where  the controls come from .. then the class name and function name to add the custom button function as described here:

(http://j0hnbane.com/wp-content/uploads/2016/09/customcontrol1.jpg)
http://orkframework.com/tutorial/howto/custom-playercamera-controls/

and here

(http://j0hnbane.com/wp-content/uploads/2016/09/keysetting.jpg)
(http://j0hnbane.com/wp-content/uploads/2016/09/inputOriginCustom.jpg)

I've had no luck with this whatsoever. I've used the SteamVR_TrackedController as the behavior.. but beyond that I'm lost. The friendly/helpful people on the ORK forums don't really know much about VR controller implementation.

So I've also been using your addon for Playmaker. I thought about trying to reference your action script for each control. I don't need the touch pad, but the trigger, grips, menu, and steam button I do need. But again, Google mixed with trial and error has not been kind.

Then I was thinking of ujsing your actions in a state, which will give me the bool of each action the Vive controller can do. With Playmaker, I was hoping to use that or make references to the script for each button's action.

If there was a way to set this to communicate through Playmaker, that would be awesome. Then I could throw in conditions prior to allowing a bool to happen.

Example:

do I have an object with the tag "Item" childed to a controller
true -> send event ->

is trigger pulled?
true -> set bool in variable named "itemPullTrigger"

Then send that off to Unity's input controls.. but .. meh

My whole workflow has been stifled for a few days now. I typically can bang my head on a wall for a bit and then break it down. But this wall has been reinforced with concrete.

Any assistance would be appreciated.

Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on September 05, 2016, 05:45:46 AM
Hey John,

This is a bit difficult without seeing how the controllers are being called on the ork framework but the main script that I constantly refer to for any commands is the SteamVR_Controller.cs script.

This is in the first line of the script itself
Code: [Select]
// Purpose: Wrapper for working with SteamVR controller input
//
// Example usage:
//
// var deviceIndex = SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Leftmost);
// if (deviceIndex != -1 && SteamVR_Controller.Input(deviceIndex).GetPressDown(SteamVR_Controller.ButtonMask.Trigger))
// SteamVR_Controller.Input(deviceIndex).TriggerHapticPulse(1000);

This may be the script you need to call instead of the SteamVR_trackedObject.cs. If this does work, the new difficulty would be explaining which controller is which. (That is what the SteamVR_TrackedObject.cs is for).

Also, if it helps, the class being called is "Device"
Code: [Select]
public class Device
{
public Device(uint i) { index = i; }
public uint index { get; private set; }

Can you try using this script and if there is no success, we can try adding bools to the scripts that trigger in the actions.

Please keep me posted. Thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: j0hnbane on September 05, 2016, 09:26:16 AM
Thank you sebas. I'll have a go at it now. I really appreciate the help.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: j0hnbane on September 05, 2016, 03:12:04 PM
Ok, definitely need to get the bools for the specific actions for the specific buttons. I looked through the public bools for that script and it looks like its calling something else to identify it based on a buttonId.

Going off of the description in the Key Settings:

Custom Button Function
Calls a static function using reflection - the function must return a bool value. Below it is a spot for the name of the function that will be called.

I can also add parameters that will be used when calling the function. As little as none or as many as needed. It can take strings, bool, int, float, vector2, and vector3.

I feel like its alllmooosstt there. I wish I was more of a contributor with this than just giving you information. I will say, if this can be worked it, its something people would probably buy.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on September 05, 2016, 05:37:44 PM
Hey John,

Can you try the action again? The store result that is in each of the actions is the Bool for them.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: j0hnbane on September 05, 2016, 07:58:39 PM
Ok, I think I can call your script "GetTrigger" for the custom script.

Which class would I need to call for and which method to get the trigger bool in your action script?

Or is there a name that I can use for the specific FSM I have the trigger action set up in as a script?

If so, what class and method would it be? It requiring me to have that info.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: j0hnbane on September 05, 2016, 08:18:38 PM
Wait a minute. I found this:

https://hutonggames.fogbugz.com/?W329

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;

public class MyBehaviour : MonoBehaviour
{
    public PlayMakerFSM fsm;

    void Update()
    {
        // getting fsm variables by name
        FsmFloat floatVariable = fsm.FsmVariables.GetFsmFloat("myFloat");
    }
}

Wouldn't this be an easier way to get the trigger bool from the FSM with your trigger action? Adding this script, then having ORK access this instead. Make it short and simple?

I'm guessing the

public PlayMakerFSM fsm;

would be the fsm name.. in this case I'd call it

public leftTriggerPulledFSM;

Then change the

FsmFloat floatVariable = fsm.FsmVariables.GetFsmFloat("myFloat");"

to something like

FsmBool boolVariable = leftTriggerPulled.FsmVariables.GetFsmBool("leftTriggerPulled")[/color]

I don't  know. Its late, lol.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on September 06, 2016, 07:18:50 AM
This would require changing the scripts in the Ork Framework. The bool Variable is already set to public but the ork script would require that get component.

And the class being called would be the same as the script name.
Code: [Select]
public class GetTrigger : FsmStateAction
    {
The rest is sent through the enum which is the trigger type.


Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: j0hnbane on September 07, 2016, 02:44:30 PM
Working on it now. I really hope this is it.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on September 23, 2016, 02:34:26 PM
The only thing i did not like, was the fact that when you pull the string, you get constant heavy haptic feedback, instead of a slowly build up. but i'm guessing that's just not possible with the current actions.

Hey LordHorusNL,

There is a new update that is live which does just this. Not sure if you were able to control the feedback but another option is available as well in the latest update!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on November 10, 2016, 02:22:44 PM
Just tried the update, great work man. Are you planning on adding more example scenes in the future btw?
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on November 10, 2016, 02:25:17 PM
Hi! I am working right now on the next update which will be based on the current example scene but adding new features into the scene involved with better object control.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: BDFgames on November 14, 2016, 11:16:09 PM
Hi there. I'm using your asset (which has been generally pretty great, I should mention) with a shooter game, but I'm having a challenge with raycasting out of the playspace. The ray seems to only want to be drawn from the floor-centre of the playspace, and I haven't yet figured out how to draw the ray from a point attached to a controller.

I assume I'm just missing something obvious?

Any help gratefully accepted. Thanks in advance.  :)
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on November 15, 2016, 05:15:54 AM
Hi BDFgames!

There is an option for ray casts that let's you place the starting position from where it says "from position" depending on what ready cat action you are using. You need to get the position of your game object and place it they're and then set the direction. Also turn the debug on to best see where it is in space.

You mentioned the play space. Is there something in the VR or Toolkit actions that looks to be affecting this? I'm using a ray cast from my gun game object as well and I followed the steps mentioned above.

Please let me know if this helps or if you have any questions on this so we can figure this out.

Thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: BDFgames on November 15, 2016, 05:32:39 AM
Hi. Thanks for getting back to me.  :)

Yes, I've tried setting the gun as the From Position. I've also tried putting the gun in a variable as using that instead, just in case that would help (it didn't). I also tried using a point in front of the gun as the origin point, but that didn't work either.

With debug on, I can see the ray starts in the middle of the floor of the Vive playspace (play area), seemingly no matter what I do, but I'll have another crack at it in the morning and start over. Maybe I'm missing something obvious.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on November 15, 2016, 06:25:32 AM
Hi BDFgames, You're right, I was going off an older model but this is my actual FSM from the game, I do not use From Position at all. I set from GameObject and that position is a child object on my gun called (Shoot). Here are images showing it.

Forget the other suggestion, I hope this helps!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: BDFgames on November 15, 2016, 06:27:28 PM
Thanks for coming back to me. I've replicated that setup again, and taking a screenshot to show you want I'm seeing.

The line renderer (laser sight) shows the correct vector that the raycast should travel, but for reasons I cannot figure out the ray's origin is the center floor of the Vive play area.

I've also tried getting the position of the gun and putting that in as the From Game Object, both in worldspace and localspace, but it seems to ignore that and always originates from the center floor of the Vive play area.

Very frustrating. Any ideas based on what you can see here?
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on November 15, 2016, 07:05:03 PM
Haha, I liked the badguy who wants a bullet.

That is really strange and I assume very frustrating when it should be working but doesn't for no reason. Looks like everything is right, have you tried the other raycast script? I assume so.

Can you give me a bare bones scene, without any of the assets of course, to see if maybe a different pair of eyes can see something missing. If you can send it to frametaleinfo @ gmail.com
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: BDFgames on November 17, 2016, 12:13:27 AM
Okay. I figured out what was going on, and it seems to be a Unity thing, or possibly a SteamVR thing.

What was happening is that, because the gun started the level unactivated, upon activating it, it seems have have reset all internal positioning to 0,0,0 in localspace. Very weird.

Resolved now, though, so I'll take the win and leave it at that.  :)
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on November 17, 2016, 05:05:22 AM
Cripes... Well, great job figuring it out! Let me know if you have any questions on the asset or if I can attempt to help out with anything else. Thanks for letting know!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on November 18, 2016, 02:06:08 PM
Hey Sebaslive, small question for you.

Is it possible to use the "get touchpad" action to make a locomotion system, so that the closer your thumb gets to the end of the touchpad the faster the player moves?

Or can you only detect if the button is pressed/touched
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on November 18, 2016, 02:43:58 PM
Sure is!

Touch pad axis outputs numbers on the X and y. You may have to get the axis and place it into the velocity you want to set on the locomotion system. Look at the touch pad axis example in the package to see a simple method of objects moving based on direction. You can apply that by using the axis as a multiplier to increase our decrease speed based on position of thumb.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: Rokuten on November 27, 2016, 12:13:56 AM
Hello have problem with.

Assets/SteamVR Playmaker/Extra/Custom Actions/GetAngularVelocity.cs(9,58): error CS1031: Type expected

Before that, problem was
The type or namespace name `FsmStateAction' could not be found.
Assets/SteamVR Playmaker/Extra/Custom Actions/SetAngularVelocity.cs(9,43): error CS0246: The type or namespace name `ComponentAction`1' could not be found. Are you missing a using directive or an assembly reference?

Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on November 27, 2016, 07:55:33 AM
Hey Rokuten! I sent replied your email earlier but in case anyone else has this come up.

Easy fix! This means that the playmaker asset needs to be installed first. So, remove the stream vr playmaker Toolkit. Next install playmaker, then steam vr asset and lastly the stream vr playmaker Toolkit.

Please, let me know if you have any troubles!

Thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on December 10, 2016, 10:13:24 PM
Added an update to the main post showing a proper installation of the asset for any of those that may be having trouble.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: jasonj_76 on December 13, 2016, 01:26:08 PM
Hi sebaslive,

Quick question if you don't mind...

I have an object that I can grab with the controllers, but I would like to have the object offset from the controller a bit so that it isn't intersecting and I'd also like the object to have a specific orientation. 

I've tried attaching an empty gameobject that is offset under the controller model and parenting to that, but I can't get it to respect the offset.  I've also tried get/set position with the same problem.  I also can't seem to get a rotated orientation either on the object.  Not sure if this is the right place to ask, but I thought it was worth a try.

thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on December 13, 2016, 01:42:54 PM
Hi Jason!

Not sure if I replied to this question before in email or here but from how I understand what you need, its to grab an object and set its position and rotation on the controller once grabbed. You can either grab the script I made or terri's here http://hutonggames.com/playmakerforum/index.php?topic=11104.msg52476#msg52476

Using this you can set up an empty game object on your controller and when the object is grabbed, you can set the position and rotation with the match transform script.

Please, let me know if this helps with what you're looking for. Thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: jasonj_76 on December 13, 2016, 01:47:21 PM
Great, thanks for the response, I will give this a try!

thanks,
Jason
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: jasonj_76 on December 13, 2016, 03:34:37 PM
One more question...Have you had any luck getting an object with a hinge joint to work with the controllers?  Using get/set position or parenting rips the object off of the hinge.  Imagine something like a door where you want it to stay in place, but would like the player to be able to grab it and open it. 

thanks,
Jason
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on December 13, 2016, 06:38:55 PM
Hey Jason,

I have yet to try when it comes to hinge joints and the controller but I did create a tutorial a while back using hinge joints. It may work with the empty game object? https://www.youtube.com/watch?v=AcxH5F5KPTA Hopefully this helps out.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: jasonj_76 on December 15, 2016, 10:54:02 AM
Thanks for the advice.  I looked at your video and there must be a problem with how the controllers interact with joints (hinge & fixed).  Using the controllers to grab any object with a joint rips the object from the joint.  So far, I've tried matching position and rotation and also tried parenting to the controller, but now I am starting to think that doing a match of velocity might be a better solution for this case.

thanks for your help,
Jason
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on December 15, 2016, 03:06:21 PM
Please, let me know how the velocity works. What object are you trying to attach to the controller?
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: jasonj_76 on December 15, 2016, 10:41:39 PM
It is a valve on a pipe that is attached to the pipe.  It is connected to the pipe with a hinge joint and turning it 90 degrees would turn off steam coming out of the pipe.

Kinda like this:

http://www.valvesandflowcontrolresources.co.uk/uploads/gallery/16/32.jpg

Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on January 08, 2017, 04:38:09 PM
Hey sebaslive

I'm trying to get touchpad movement working where the player moves in the direction the controller is facing.

I am able to get the xy inputs and apply velocity to the player/camerarig easy enough but have not been successful in getting the rig to move in the direction of the controller.

(http://i63.tinypic.com/34qlnop.jpg)

I've tried getting the controller rotation and applying it to the rig, but no luck.
Can you give me any tips on how i could achieve this?
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on January 08, 2017, 11:43:26 PM
Hey LordHorusNL,

This is a bit trickier but in most cases based on direction we must use the Transform Direction action. We want to know where Forward is and forward is always +1 on Z.

So we have the touchpad axis first. Then we use the transform direction, and I set it up to move forward based on where I am looking, so for the game object, I set it to Camera (head). In local direction I set the X and Y to 0 and Z to 1. I then stored the Vector 3 result.

Next we Get Vector 3 XYZ (action) from our new vector 3 variable and store the X (headset x) and Z (headset z). Now I use Get Vector2 XY and store the Y (axis Y). I use the float multiply action to multiply headset Z by axis Y (so that if not touching the touchpad it will be at 0 therefore multiplying any value to 0 so the only movements that occur are when the touchpad is pressed). I then multiply headset X and by axis Y. Now we create a new Vector 3 (headset) and set the X to headset x and Z to headset Z (I also set the Y to zero so that it will always be zero). And I used translate to move the headset, I set the game object to Camera Rig and Vector to my new headset variable. Now any direction I look, and I press down on the touchpad y it will move forward in that direction.

That will move your character, if you would also like to use the X on touchpad axis, you would do the same steps but now add the two vector3's at the end together and place that new variable in translate. I would suggest testing out different methods of movement to see what works best for you.

I hope this helps! If you have any questions, please let me know!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on January 09, 2017, 08:45:36 AM
Thank you so much, this worked perfectly! now i don't have to use VRTK for movement anymore.

Like the poster above i am also interested in using playmaker to operate doors/levers on hinges, so that will probably be my next hurdle ;D

Thanks for the great support man!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on January 09, 2017, 09:10:40 AM
Great! Glad it worked, it is actually the same method VRTK uses their movement but done using Playmaker actions instead of scripting.

I have been wondering how Jasons testing went with the velocity. But keep me posted if you find something that works for your levers!

and you're welcome, very happy to help.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on January 12, 2017, 01:29:37 PM
FYI: Steam has updated their plugin, which is not currently working with the Toolkit scripts yet. I will update here when available, thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: stitchlips on February 15, 2017, 03:22:41 PM
Hey LordHorusNL,

This is a bit trickier but in most cases based on direction we must use the Transform Direction action. We want to know where Forward is and forward is always +1 on Z.

So we have the touchpad axis first. Then we use the transform direction, and I set it up to move forward based on where I am looking, so for the game object, I set it to Camera (head). In local direction I set the X and Y to 0 and Z to 1. I then stored the Vector 3 result.

Next we Get Vector 3 XYZ (action) from our new vector 3 variable and store the X (headset x) and Z (headset z). Now I use Get Vector2 XY and store the Y (axis Y). I use the float multiply action to multiply headset Z by axis Y (so that if not touching the touchpad it will be at 0 therefore multiplying any value to 0 so the only movements that occur are when the touchpad is pressed). I then multiply headset X and by axis Y. Now we create a new Vector 3 (headset) and set the X to headset x and Z to headset Z (I also set the Y to zero so that it will always be zero). And I used translate to move the headset, I set the game object to Camera Rig and Vector to my new headset variable. Now any direction I look, and I press down on the touchpad y it will move forward in that direction.

That will move your character, if you would also like to use the X on touchpad axis, you would do the same steps but now add the two vector3's at the end together and place that new variable in translate. I would suggest testing out different methods of movement to see what works best for you.

I hope this helps! If you have any questions, please let me know!

You don't happen to have a screenshot of this do you? We tried to get it working and it kind of works. When you press up on the trackpad, you go in a northwest direction instead of North. Does that make sense?
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on February 15, 2017, 03:38:10 PM
Hey Stitchlips,

Can you go through your actions closely to make sure that there is nothing being grabbed by any other axis in the steps. If you are going in any axis other than Z (forward) than it most likely is that in creating a new vector or the translate, another value (maybe X) has been accidentally placed in. I don't have any screenshots, but I will take this into account for the next update.

Please let me know if this helps and thanks for the question/suggestion.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: stitchlips on February 15, 2017, 04:27:09 PM
Hey Stitchlips,

Can you go through your actions closely to make sure that there is nothing being grabbed by any other axis in the steps. If you are going in any axis other than Z (forward) than it most likely is that in creating a new vector or the translate, another value (maybe X) has been accidentally placed in. I don't have any screenshots, but I will take this into account for the next update.

Please let me know if this helps and thanks for the question/suggestion.
Thanks for the quick reply. Let me give it a look.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: stitchlips on February 16, 2017, 09:45:17 AM
Hey Stitchlips,

Can you go through your actions closely to make sure that there is nothing being grabbed by any other axis in the steps. If you are going in any axis other than Z (forward) than it most likely is that in creating a new vector or the translate, another value (maybe X) has been accidentally placed in. I don't have any screenshots, but I will take this into account for the next update.

Please let me know if this helps and thanks for the question/suggestion.

All right. We got it working. Thanks for the help!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on February 16, 2017, 09:50:32 AM
Great! What was going on? In case anyone comes across the issue, was it the x value?
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on March 01, 2017, 02:50:00 PM
I have a problem with the "get trigger" action on unity 5.5.2f1

it does not trigger or triggers sporadically.

(http://i64.tinypic.com/nvv50i.png)
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on March 01, 2017, 04:03:25 PM
Hey LordHorusNL,

Looking into the issu and have also sent you an email with a few questions. I'll respond back here with a fix for anyone else having this issue.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on March 01, 2017, 05:34:36 PM
Was probably a VRTK issue, so case closed. Thanks for the help!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on March 01, 2017, 05:36:51 PM
You're welcome! Please, keep me posted on any developments. Thanks
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: tcmeric on April 21, 2017, 03:24:39 AM
Hi Sebaslive, fan of your work. I own your asset. (I think I own most of the vive type assets at this point)  8)

I am trying to simulate mouse clicks in steamvr. Ie, I would like to point a "laser" (raycast) at the ground and have my third person controller gameobject move there. I can do this using mouse clicks in playmaker, but not sure how to go about this using steamvr/playmaker and your asset. Basically I need to get a vector 3 location to pass to the third person controller. Any ideas?
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on April 21, 2017, 06:10:08 AM
Thanks!

The best way would be to use a raycast. Specify the gameObject as your right or left controller and for Direction set it to 0,0,1 on Z. The next thing you can do is Store the Hit Point, as this will tell you the location(vector3) of the floor where your ThirdPersonController should move. Next you could set a layerMask to only hit the floor so it does not hit any other objects.

The way I usually set it up is to only run the raycast once I hit the trigger on my controller so the raycast is not running everyframe. That should give you the vector3 you need to move your object. I hope this helps!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: tcmeric on April 24, 2017, 08:46:49 AM
Great, thanks!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on April 26, 2017, 07:04:45 AM
Hi Sebaslive, i have a small problem with the get controller velocity and get controller angular velocity actions.

I have a object that i can pick up, and i currently run these actions in a FSM on that object, i get the controller velocity and set it on the object itself after release (throw) This is very simple offcourse, however i've never been able to get a usable vector3 with your actions (except when running from a FSM on the controller itself)

I'm currently using a action from the other vive playmaker asset to make my script work, however this does not allow me to input both controller and i would prefer to use your actions.

I really need to runs these actions on the object itself and not the controller.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on April 26, 2017, 08:05:09 AM
Hey LordHorusNL, I'm sorry, I'm not exactly sure what you mean. You would like to get the controller angular velocity and controller velocity from an FSM that is not attached to the controller? Are the Get controller velocity and angular not working as they should?

In the example scene that comes with the package, if you click on the sphere it has an FSM that gets the velocity and angular velocity from either controller. Does this help with what you need?
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: LordHorusNL on April 26, 2017, 09:58:42 AM
Yeah checked out the example scene, and it works great in that scene, however when i try to replicate the same setup in another scene it does not seem to work for me.

Is it okay if i send you a small test scene to see if you have the same issue?

Thanks
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on April 26, 2017, 11:24:10 AM
Yes, please do!
Title: Assign Controller?
Post by: beowulfkaine on May 01, 2017, 10:33:23 AM
Is there a way in playmaker that I can have PM automatically save the controller the object comes in contact with  to a variable that can then be used where you have to specify a controller? As it is now I have to choose either left or right.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on May 01, 2017, 03:32:55 PM
Yes. One way would be to set colliders onto your controllers. Than when you interact with another object. You can use the trigger event to get the object that collides with the trigger and set that to the controller.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: topscore1632 on May 09, 2017, 06:11:36 AM
Hey, did LordHorusNL ever get a resolution to his problem? I'm having exactly the same thing occur. Test scene throwing the ball works fine, but trying to replicate in my own scene and it the Get Controller Velocity and Get Controller Angular Velocity actions do nothing - I'm storing as a Vector3 every frame but when you click 'Debug' the variable is never changing.

The only thing I can see that's different, is that I have added the SteamVRUpdatePoses script to the 'Camera (Eye)' object in my scene. I have to do this or my controllers do not show up in game.

**UPDATE: NOW FIXED** I eventually worked this out after trying all day! The problem was the Rigid Body on the controller - it had Is Kinematic enabled and this needs to be DISABLED for the Get Controller Velocity action to work.
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on May 09, 2017, 08:12:30 AM
Yes this was the same problem, glad you were able to get it!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on June 12, 2017, 02:47:45 PM
For anyone having trouble with the latest Unity v5.6 and Steam 1.2.1

Quote
The current beta version of Unity 5.6 breaks the normal operation of the SteamVR_UpdatePoses component (required for tracked controllers). To work around this in the meantime, you will need to manually add the SteamVR_UpdatePoses component to your main camera.

Edit: Also, the update poses script has to be changed. Replace it with the one attached. That should work. Hopefully steam vr and unity become compatible again soon with a future update. If not, there will be changes to the toolkit to accommodate the new player prefab. If there are any problems, or questions, please let me know!
Title: Re: Steam VR Playmaker Toolkit - Help Board [VIVE]
Post by: sebaslive on June 29, 2017, 12:50:07 PM
The New steam VR 1.2.2 seems to fix the last issue and does work with the toolkit.