Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: westingtyler on August 14, 2016, 01:03:37 AM

Title: Actions for the Oculus Touch? (solved, we got'em)
Post by: westingtyler on August 14, 2016, 01:03:37 AM
BAM: Solved. FrameTale Studios made an asset store kit that contains all the Oculus Touch playmaker actions we need. I was able to test them, and they work, and I'm implementing touch controls right now in my VR game. Get the pack on the asset store!

Here is their store page. I can attest that support and documentation is pretty good. https://www.assetstore.unity3d.com/en/#!/search/page=1/sortby=popularity/query=publisher:6138

Original post:
I am a dev with an Oculus Touch coming in the mail, and I am wondering if Playmaker has or even needs Oculus Touch support? As in, are there any new actions that need to be written to be able to use the Touch in Unity?

Here is the input documentation for Touch, but without Playmaker I would have no idea how to use it. https://developer3.oculus.com/documentation/game-engines/latest/concepts/unity-ovrinput/ (https://developer3.oculus.com/documentation/game-engines/latest/concepts/unity-ovrinput/)
Title: Re: Actions for the Oculus Touch?
Post by: Kazy on September 16, 2016, 03:21:34 AM
Seconded. The Vive has nice actions that expose the status of the controllers, but the Touch doesn't.
Title: Re: Actions for the Oculus Touch?
Post by: Nodixal on November 04, 2016, 01:21:51 PM
Would love this as well! Released a game for the vive using the playmaker vive actions. Touch are coming soon and wanted to port the game to it.
Title: Re: Actions for the Oculus Touch?
Post by: jeanfabre on December 01, 2016, 02:23:37 AM
Hi,

 yes, basically I don't own an Oculus Touch so I can't really port this without great risks of doing actions that do not work at all... :)

Maybe someone from the community would be ready to tackle?

there is a task on trello for this: https://trello.com/c/hEJlmimx/4-oculus-rift

Maybe U Prashanth has some of the actions done already?

Bye,

 Jean
Title: Re: Actions for the Oculus Touch?
Post by: sebaslive on December 14, 2016, 01:50:02 PM
Doesn't seem like oculus needs actions. From what I can tell, everything uses the input manager as opposed to the Vive.
Title: Re: Actions for the Oculus Touch?
Post by: westingtyler on February 19, 2017, 07:56:49 PM
If Touch uses the Input Manager, can you tell me what button to use for the Oculus Touch button down and button up and thumbstick axes? I've tried sifting through dev docs but can't make heads or tails of this. I just need to know how to set up the touch axes/buttons in the input manager, then I can make my world-changing game.

https://developer3.oculus.com/documentation/game-engines/latest/concepts/unity-ovrinput/

that's all the info, i THINK, but as a non coder, I would not know how to make actions myself.

My input manager shows entries for Oculus Gear VR Thumbsticks, etc. Can anyone confirm there should be MORE inputs, or are these the ones to use?
Title: Re: Actions for the Oculus Touch?
Post by: Mulbin on February 22, 2017, 05:26:15 AM
The touch does use the input manager... but for some reason GetButtonDown in playmaker completely ignores button presses from the touch.
Title: Re: Actions for the Oculus Touch?
Post by: westingtyler on February 28, 2017, 12:31:02 AM
Mulbin, can you tell me what the "button names" are for the Oculus Touch, or post a screenshot of their entries into the Input Manager?

what are you choosing in the "Get Button Down" action?
Title: Re: Actions for the Oculus Touch?
Post by: Mulbin on March 01, 2017, 05:03:12 AM
It's all detailed here... but a bit beyond my understanding.

https://developer3.oculus.com/documentation/game-engines/0.8/concepts/unity-ovrinput/

I'm wondering if the function GetButtonDown just doesnt work with an Oculus Touch as the buttons work differently to normal controllers, they each have 2 or 3 states as they can be pressed, gently touched or proximity sensed.
Title: Re: Actions for the Oculus Touch?
Post by: Mulbin on March 01, 2017, 05:39:57 AM
After looking at a couple of scripts it looks like "Getbuttondown" just isn't how you use oculus controllers.

The scripts all seem to use something called OVRInput.GetDown

As I'm not a coder, I don't really know how to procedd from there.
Title: Re: Actions for the Oculus Touch?
Post by: tcmeric on March 08, 2017, 01:50:28 AM
Checkout VRTK. It supports Oculus SDK.

https://vrtoolkit.readme.io/docs
(see list of SDKs).

I may be able to provide some basic playmaker actions for controller input. I have created them for Vive for VRTK. But I can only do so via VRTK, so you would need to have that.

I cannot test them as I don't have Oculus, but that should easy enough for you to do.
Title: Re: Actions for the Oculus Touch?
Post by: Mulbin on March 11, 2017, 06:42:02 AM
I've managed to write a script that uses OVRGetInput and activates empty game objects when buttons are pressed. Then I just use playmaker to get the sate of the game objects to detect if buttons are pressed.

It's clunky, but will do for now.
Title: Re: Actions for the Oculus Touch?
Post by: tcmeric on March 13, 2017, 01:20:55 PM
Nice. I am glad it is working out for you  8)
Title: Re: Actions for the Oculus Touch?
Post by: westingtyler on April 03, 2017, 02:24:53 AM
mulbin, any chance of making that object activation touch script public? I still desperately need touch support for my vr playmaker game. currently it uses mouse and keyboard, but mouse pick translates wrongly since unity 5.0, so it's totally messed up.
Title: Re: Actions for the Oculus Touch?
Post by: Mulbin on April 15, 2017, 05:42:30 AM
Hi, sorry missed your reply!  Here you go, just drop this on an empty game.  You then create more empty objects (set them as disabled) and drag them into the fields this script creates.  When you press or release the buttons the game objects will activate/deactivate giving you something easy for playmaker to see.

Code: [Select]
using UnityEngine;
using System.Collections;

public class TouchController: MonoBehaviour {

// Use this for initialization
void Start () {

}
    public GameObject RightIndexTrigger;
    public GameObject LeftIndexTrigger;
    public GameObject LeftHandTrigger;
    public GameObject RightHandTrigger;
    public GameObject AButton;
    public GameObject YButton;

    // Update is called once per frame
    void Update ()
    {
        if (OVRInput.Get(OVRInput.RawButton.RIndexTrigger))
        {
            RightIndexTrigger.SetActive(true);
        }
        else
        {
            RightIndexTrigger.SetActive(false);
        }
   
        if (OVRInput.Get(OVRInput.RawButton.LIndexTrigger))
        {
            LeftIndexTrigger.SetActive(true);
        }
        else
        {
            LeftIndexTrigger.SetActive(false);
        }

        if (OVRInput.Get(OVRInput.RawButton.RHandTrigger))
        {
            RightHandTrigger.SetActive(true);
        }
        else
        {
            RightHandTrigger.SetActive(false);
        }
        if (OVRInput.Get(OVRInput.RawButton.A))
        {
            AButton.SetActive(true);
        }
        else
        {
            AButton.SetActive(false);
        }
        if (OVRInput.Get(OVRInput.RawButton.Y))
        {
            YButton.SetActive(true);
        }
        else
        {
            YButton.SetActive(false);
        }
    }
}
Title: Re: Actions for the Oculus Touch?
Post by: westingtyler on April 16, 2017, 09:51:51 AM
this could be a big deal. thanks for the script, and I will check it out!
Title: Re: Actions for the Oculus Touch?
Post by: westingtyler on April 16, 2017, 10:54:34 AM
I am getting this error:

Assets/OvrTouch/Script/Services/TouchVisualizer.cs(74,26): error CS1061: Type `TouchController' does not contain a definition for `SetVisible' and no extension method `SetVisible' of type `TouchController' could be found (are you missing a using directive or an assembly reference?)

What am I missing here? The script doesn't even use anything called "SetVisible". Is it saying I don't have Touch installed or something?

so i deleted the OVRTouch folder, now I get an error:

Assets/TouchVisualizer.cs(4,14): error CS0101: The namespace `global::' already contains a definition for `TouchController'

Below the script, it says "the associated script cannot be loaded. fix any compile errors and assign a valid script."

Do you have any suggestions for this?
Title: Re: Actions for the Oculus Touch?
Post by: Mulbin on April 17, 2017, 06:07:45 AM
Sorry, haven't a clue!  Still hoping we get native support for VR in playmaker.
Title: Re: Actions for the Oculus Touch?
Post by: sebaslive on April 17, 2017, 05:06:27 PM
I made a slew of scripts that I plan to release to the store but for my Oculus version of the steam playmaker toolkit, but I would like to see if anyone would like the package to test it before launching? I would like to see if it has all the actions necessary for your title.
Title: Re: Actions for the Oculus Touch?
Post by: westingtyler on April 24, 2017, 06:06:35 PM
so you are making a "oculus playmaker toolkit" with Touch support? if that is the case, I'd be happy to test it, but I can't guarantee I'm great at it since I've never tested for anyone before. if you have any specific things you want me to test for, I could be sure to do that, too. i am somewhat slow, however, which might affect things.
Title: Re: Actions for the Oculus Touch?
Post by: sebaslive on April 25, 2017, 10:25:10 AM
Hey Westinytyler,

Please, send an email to frametaleinfo(@)gmail.com with the request and I will send it. Thanks!
Title: Re: Actions for the Oculus Touch?
Post by: sebaslive on June 03, 2017, 08:18:45 PM
Hey All, thank you everyone! We are no longer looking for testers but we really appreciate everyone that was able to test the actions!
Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: Team3D on June 28, 2017, 10:48:23 AM
Hello, do these actions work with the new Samsung Gear VR? (the one that comes with the small controller)
Thanks.

Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: sebaslive on June 28, 2017, 12:26:44 PM
Hi, not yet. This works with the oculus touch controller and oculus remote.
Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: Team3D on June 29, 2017, 05:18:32 AM
Do you have any plans to release actions for the Samsung Gear?

Thanks.
Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: sebaslive on June 29, 2017, 10:16:33 AM
Absolutely, as the Samsung gear is also a big player in the vr department and the new gear controller is great. There will be actions coming for it as well.
Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: Mulbin on August 10, 2017, 05:35:45 AM
can anyone confirm if the asset works on 5.4?  No way I can upgrade to 5.6 without generating months of repairs.
Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: sebaslive on August 10, 2017, 10:45:48 AM
Hey  Mulbin,

I believe it only works on the latest versions mostly because of the new openvr and oculus api.
Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: sebaslive on August 16, 2017, 02:30:19 PM
Anyone that is having errors on 2017 version with oculus. The code in OvrOverlay is currently not working.

Replace the OvrOverlay file attached with the one in your project.

This is a temporary fix until Oculus gets the latest version working.
If you have any questions please let me know!
Title: Re: Actions for the Oculus Touch?
Post by: PolyMad on October 14, 2021, 05:25:14 PM
Hi, sorry missed your reply!  Here you go, just drop this on an empty game.  You then create more empty objects (set them as disabled) and drag them into the fields this script creates.  When you press or release the buttons the game objects will activate/deactivate giving you something easy for playmaker to see.

Code: [Select]
using UnityEngine;
using System.Collections;

public class TouchController: MonoBehaviour {

// Use this for initialization
void Start () {

}
    public GameObject RightIndexTrigger;
    public GameObject LeftIndexTrigger;
    public GameObject LeftHandTrigger;
    public GameObject RightHandTrigger;
    public GameObject AButton;
    public GameObject YButton;

    // Update is called once per frame
    void Update ()
    {
        if (OVRInput.Get(OVRInput.RawButton.RIndexTrigger))
        {
            RightIndexTrigger.SetActive(true);
        }
        else
        {
            RightIndexTrigger.SetActive(false);
        }
   
        if (OVRInput.Get(OVRInput.RawButton.LIndexTrigger))
        {
            LeftIndexTrigger.SetActive(true);
        }
        else
        {
            LeftIndexTrigger.SetActive(false);
        }

        if (OVRInput.Get(OVRInput.RawButton.RHandTrigger))
        {
            RightHandTrigger.SetActive(true);
        }
        else
        {
            RightHandTrigger.SetActive(false);
        }
        if (OVRInput.Get(OVRInput.RawButton.A))
        {
            AButton.SetActive(true);
        }
        else
        {
            AButton.SetActive(false);
        }
        if (OVRInput.Get(OVRInput.RawButton.Y))
        {
            YButton.SetActive(true);
        }
        else
        {
            YButton.SetActive(false);
        }
    }
}

Hi,

I know this is quite old but maybe you are still roaming around.
I bought the Oculus Touch Playmaker package but got a bunch of problems with existing Playmaker assets.
So I was wondering if just getting these to check the buttons would work.
It didn't.
I created a C# file in Unity, pasted this in it, then tried to add it to a game object, but Unity says that "The script doesn't inherit a class blablabla".
What to do?
Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: PolyMad on October 14, 2021, 05:27:17 PM
Go these nice warnings that don't let me compile my project.
Luckily I backed it up right before installing (I knew this wouldn't go smooth...).
What should I do?
Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: djaydino on October 15, 2021, 12:07:26 AM
Hi.
The errors show duplicate issues which means that you have at least 2 of them in your project.

try the search the .cs filenames to find them
Title: Re: Actions for the Oculus Touch? (solved, we got'em)
Post by: PolyMad on October 15, 2021, 05:23:37 PM
Hi.
The errors show duplicate issues which means that you have at least 2 of them in your project.

try the search the .cs filenames to find them

Yess! Solved, thank you!