Purpose:
To allow users to interact with your VR projects without the need for an external controller. Also works great in regular 3D space.
How It Works:
The crosshair (with the zapper script attached) does a raycast in the direction you’re looking and detects any object with a physics collider tagged “NoTouchButton”, so anything you put in the crosshairs, your users can interact with. This system sets up a series of visual cues for interaction using bar and radial timers. You can customize the time to activate/deactivate and cool down periods as well as call functions on game objects during activation and deactivation phases, using the SendMessage function. I tried to make it modular and easy to use so you can just drop the script or prefabs on your object and it works with minimal setup.
Why:
I developed this system for VR games that require a controller so those people who don’t have a controller can still get around and interact with your project. It’s not great for high twitch gaming but would work nicely for casual games were the player works at their own pace and it would be great for targeting objects for turret/shooter games. I have included some uses for these in the demo scenes.
Development:
Currently this is a quick mockup of the general idea that I originally indented to use as an autowalk toggle, it was made just for buttons but I am working on integrating it with uGUI and adding in other options besides timer bars to indicate wait times, expanding panels with multiple options, and other cool features for a total “no click” gui experience.
How to Use (Simple):
Add your crosshair sprite inside of your camera group (for VR using 2 cameras).
Attach the Zapper script to it. This sends out the raycast that the buttons will receive.
Drag the DemoButton prefab to your scene wherever you want it.
Make sure to create a new tag called “NoTouchButton” and assign it to the DemoButton.
Adjust parameters of the ZapperAction script on your DemoButton to your liking.
Add code to your scripts to control objects… see demo for examples
Known Issues & Tips:
This system is based on Sprites, and therefore doesn’t use any uGUI or onGUI stuff, that way you can set depth and registration points, as well as colors at runtime
Any object you want to interact with, the parent object and/or the object with the zapper action script on it need to have a physics collider attached to catch the raycast
If using a timer, you need to make a parent object called HorizontalFillBar, VerticalFillBar, and CircularFill and it HAS to have an object called “fill” as a child. That fill is either a bar or the radial fill.
The crosshairs need to be within the capsule collider for the character controller or it will get clipped near walls, you can scale it down but place it right in front of the camera
Make sure to add the “NoTouchButton” tag to your scene and any objects you want to interact with, the Zapper script will only respond to that tag, consequentially, you can turn objects on and off by changing their tag
The camera hierarchy should be setup like so: Player → CameraGroup → Camera + Crosshair where the Player has the movement scripts and the camera group has the mouse look or VR scripts, and the crosshairs have the zapper script attached, inside the CameraGroup with the camera. If using the Durovis Dive plugin, the Camera Group would be the DiveCamera prefab. See images below.
This was made to be used for VR with the Durovis Dive plugin, and works great with it, but will also work in regular 3d and 2d, and should work fine with other VR solutions (such as Oculus)
Hopefully I did respond to you, I got a lot of email and tried to help everyone but sometimes things fall through the cracks…
If you still need help I’m available on Twitter @BaconNeckGames, on the contact form on our website at http://www.baconneckgames.com/contact-us or you can email dev at bacon neck games [dot] com.
Thanks to everyone who purchased and has helped support us! The asset is doing great and some big updates are planned for this summer
If you have recently purchased No Touch GUI for VR and are using the Durovis Dive sdk, download and use v2.0r499 and NOT v2.0r500!!! They changed a lot of stuff and the newer version no longer works (nor will it let you test in the editor which I find strange). I will make an update as soon as possible.
Thank you for your understanding and let me know if you have any other questions. Thank you!
There is a player prefab for google cardboard that works out of the box (but there are instructions for some stuff you have to do before you get started so the prefabs work - like import the Cardboard SDK). There is a detailed PDF with instructions included.
Then, the horizontal and vertical bars can all be customized, you can easily change the color of the sprite in the inspector, change their scale or whatever you need, it just has to maintain the name, inside the prefab (again I explain why in the instructions) but as long as you keep the names you can change scale and color of the fill and background. The radial timer is different b/c it requires a shader and a material, but I can send the PSD files or send new images for the radial timer material so you can create different colors. It’s kinda a pain but I have no problem sending them to you. I have to learn how to tint a shader before the radial timer can be customized like the others.
Hope that helps, enjoy and good luck on your VR projects!
Hello and thanks for creating this asset. I purchased it today to avoid dealing with headaches scripting related… I followed your first steps to set up the asset. Though the missing script from the prefab wasn’t missing at all…
I dragged and dropped the VR Durovis Dive prefab in my scene and hit play, I was just able to move around. seems like it was impossible for me to look around. I only have the dive version 2-0-r502. Not sure if it’s because of this…
If it’s possible for you to send me a link to download the V2.0r499 maybe that would help me out.
looks like I managed to get the camera look around by drag and dropping onto the Dive_Camera the mouse look script from the Dive Unity Demo / Script folder. Not sure if it’s the right way to do that. I also had to set the min Y / max Y to 90 and-90 so it can see the autowalk button on the floor. works great now. Maybe you should edit your .pdf. Or maybe i missed something…
Anyways. Great work! and thanks a lot!
I purchased No Touch Gui the other day and I am using Unity 5 and the Durovis Dive SDK. I was wondering if there would be any updates soon? I am able to run the Demo on my iphone but I can’t get my character to walk. I can look at the Information Screen and the yellow icon activates when I look at it, but nothing happens after that. I’m getting a lot of errors in Unity for .Move, so I’m sure its related to that. I tried to follow the advice in the Manual but I’m a bit of a C# noob. Can you point me in the right direction? I know there is something about changing the autowalk function in the Dive FPS Script
Thanks!
Hey there, email me at dev@baconneckgames.com and I can send you the version of Dive that I developed with, I used Dive v2.0r499 and any version after that, it breaks. It should get you going at least. The other problem is that the Unity 5 character controller is based on applying forces to a rigidbody player, wheras the Unity 4 version was based on the character controller scripts.
Here is something I wrote on our website: Whatever scripts you use to drive the character, you kinda just toggle a function that will either a) tell the character controller that the forward button is being pressed (by saying something like vertical input = 1), or b) by adding a forward force to the player using physics and rigidbody’s. Of course that all depends on how the player is setup, like Unity 4 standard character controller uses the input method and Unity 5 sample FPS player uses rigidbody and force.
Basically what is happening with that FPScontrollerScriptForDive or whatever is that I simply created an integer variable called autowalk and a function called autowalkToggle that changes that integer to a 0 or 1 depending on what it is currently set to. So if autowalk is off, it is at 0, and if you activate the button for autowalking at your feet, it has the BNG_ZapperAction script attached to it, which will ‘callFunctionOnActivate’ with the string “autowalkToggle”, to the FPScontroller script and just tells it to toggle the autowalk from 0 to 1, and if it’s at 1 it turns it to 0. THEN, the important part is that somewhere in the FPScontroller script, where the forces and input actually move the player (in Unity 5 it’s forces on the rigidbody so you can find and fix), we just say only add the force if autowalk is 1, so when you toggle it, it acts like it is receiving input (like a positive “1” for vertical input, as if the ‘w’ key is being pressed – not related to the integer). You can look any script in the External scripts folder I customized, and see where this line is and just duplicate something like that for Unity5’s FPS character controller.
Hope that helps! I am working on lots of major updates and it will be awesome, but another month or so away.
Hi , i bought his today … and getting this error while importing this in the latest version
Please help.
Assets/NoTouchGUI Assets/Scripts/demo scripts/BNG_NonVRWalk.cs(7,20): error CS0246: The type or namespace name `FPSInputControllerForNoTouchGUI’ could not be found. Are you missing a using directive or an assembly reference?
Hey @frank45 ! This can be fixed by dragging the BNG_NonVRWalk.cs from the No Touch GUI Assets/Scripts/External folder into the Standard Assets folder. In the support doc there is some stuff you have to do in the “Before You Start” section, this is I think step 6. Also, if you are using Dive let me know and I can send you the version of Dive I used to create this demo so that it won’t break. Hope that helps, let me know if you run into any other issues!
Thanks for the great Assets. Have just started with Unity and the No Touch GUI for VR and I’m trying to work out how to load another scene from an object/button. Am using Google Cardboard.
I’ve added the BNG_Zapper Action script to the object, tagged it with NoTouchButton and also added this script to load the next scene.
#pragma strict
function LoadLevel () {
Application.LoadLevel(“videoscene”);
}
But it doesn’t do anything with the crosshairs over it. However it does rotate the object with camera so it’s detecting something. I also tried adding the above script to the VR Player for Google Cardboard but still no joy.
I understand it’s probably just a script issue and am new to js etc. but any quick tip would be appreciated.
Cheers
It seems the script is ok as another scene loaded fine when using your demo button prefab. So it seems to be related to the object. It’s a sphere model created in Blender that was imported. I created a prefab and dragged the object in. But it still can’t be detected with the crosshairs. However, as previously mentioned the object will rotate with the camera if checked in the BNG Zapper Action settings
Any ideas why the sphere can’t be detected? Or can only sprites be detected?
Cheers
Hi,
For Unity 5, I’m confused about the step 6 and step 9.
Step 6: There is no "Standard Assets/Character Controllers/Sources/Scripts path in Unity 5, instead it is “Standard Assets/Characters/” path. So where should I put the FPSInputControllerForNoTouchGUI.js file?
Step 9: “Activate either the “Player for VR”, “VR Player for Durovis Dive”, “VR Player for Google Cardboard” or the “NON VR PLAYER” game objects”. How to active one of these object? I don’t see an active option when i right-click them.
Hey @demonbit , for step 6, you will need to download the standard character controller from the old Unity 4 assets, or there should be a folder for standard assets, anywhere in the standard assets folder will be fine.
For #9, sorry for the confusing language, by “activate” I meant to enable one of the gameobjects in the hierarchy that is a VR Player Prefab. So I think it’s set to Google Cardboard by you can turn that off and enable, or turn on, a different player prefab in the hierarchy, to start moving around the scene.
Hey Redoo, sorry, I just realized that I don’t receive notifications when someone posts on here, luckily, you emailed me and I responded and we figured it out. It turns out for anyone here looking for answers, that the “Ray Length” on the BNG_Zapper script was set too small, so making that number bigger helped him activate the photo sphere.
And a note for anyone else, this is probably the last place I check for stuff, but I will setup notifications so I know when someone posts here. Other than that, you’ll probably get a faster response through our website or by emailing me directly at dev@baconneckgames.com.