SmoothFollow camera in VR - unity3d

In a test scene with a locomotion character, when I attach a SmoothFollow script to the character, it works as it should, but when I use Oculus Rift to view the scene in VR, it no longer follows the character as it walks...
I am aware that the camera transform is over-ridden with the head-tracked pose, and that if I want to move the camera, I must attach it as a child to another game object and then move the root game object, but doing so still would not let me follow the character in VR.
Am I missing something, or is it not possible to have this in Oculus Rift where you can just make the character walk and you automatically follow it?

It sounds like you are close. Did you attach the SmoothFollow script to the new GameObject (parent of the camera) rather than the camera itself?
Also, you may want to comment out the part of SmoothFollow where it sets the rotation of the camera - this can be very disorienting in VR.

Related

Oculus Headset detached while oculus attached with the pc

I am working on the Oculus project, The player character for my simulation in Unity. in which I have firstperson controller, I have created game object of player in which I put FPCamera as a child and character's body.
Issue: When I attach my oculus camera it detached from the body and with the Oculus headset movement, FPcamera act as a separate view from the body. the body does not rotate and remain static even though FPcamera is moving according to the headset. However it works fine if I disable oculus and move the character with the mouse, I can see my body and move left right everything with all animations.
I have the following link for the oculus controllers integrations in my project
https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022 (Oculus integration)
here is a link which I have to achieve for my project, my FirstPerson should be like this in Oculus. you can see that the movement is with accuracy according to its headset movements
https://www.youtube.com/watch?v=7GpxsI-Tag
Note: I am using Unity 2017, there is no crash report in the project
First of all send the correct link for the video please.
When i create a new scene and I want to implementate the oculus player,cameras and hands I make this:
Find "OVRplayercontroller" prefab and drag to the scene
Find "CustomHandLeft" and "CustomHandRight" and drag to the scene
Go to the child object in OVRplayercontroller>OVRcameraRig>TrackingSpace
Then selec the 2 hands
And drag the TrackingSpace object to the "Parent transform" property in the OVRGrabber script in the 2 hands
Hope it helps you
You can use "OVRPlayercontroler"

Hotspot visibility in virtual tour for VR headset

I am creating virtual tour for VR headset in Unity - I create sphere and fill it with panoramic photo as material. For every sphere I create hotspots to switch to another scene after looking at it. I was testing it with Oculus Rift DK2. The sphere was visible, but the hotspots were visible all - for all scenes, but I need to see just hotspot for the current scene [1]. Anyone has idea hot to do it? Maybe something with transparency of spheres, but I saw just hotspots, not other spheres, so I think that sphere transparency is ok.
[https://i.imgur.com/F3S9C8w.png] - here you see also other scenes, in VR headset there are only hotspots, the spheres are not visible. This is right, but about hotspots - I need to see just that one for actual sphere, not all.
I was creating virtual tour according to this tutorial: https://tutorialsforvr.com/creating-virtual-tour-app-in-vr-using-unity/ ; you can see there also script for hotspots.
Thank you for all comments.
Make in your script public GameObject scena1Sphere, scena2Sphere, scena3Sphere;. And connect that game object from hierachy to sript fields. Then you can type:
//for first scene
scena1Sphere.SetActive(true);
scena2Sphere.SetActive(false);
scena3Sphere.SetActive(false);
//then when you switch to scene 2
scena1Sphere.SetActive(false);
scena2Sphere.SetActive(true);
scena3Sphere.SetActive(false);
// and for third scene
scena1Sphere.SetActive(false);
scena2Sphere.SetActive(false);
scena3Sphere.SetActive(true);

label text on Controller Unity VR

I want to add label of text on my controller of HTC VIVE in Unity like that but after many research on internet, I don't find how to do.
Someone can help me ?
thank you !
Steps to create text on controller :-
1.Drag camera rig prefab in your scene.
2.Attached Player script of stream VR plugin on camera rig.
3.Attached Hand script on both controllers.
4.Create a empty game object as a child of each controller ,set their local positions at (0,0,0) .Now add script ControllerButtonhints on both. Drag controllerbuttonhints material on controller material ,set any flash color,drag prefab controllertexthint from stream VR prefabs.
5.In Hand scripts drag other hand i.e. in left controller drag right controller and in right vice versa , set starting hand type is Any for both controller.,drag controller prefab as blank controller prefab in stream VR .
In player script ,drag camera rig to tracking origin transform, add camera eye as hmd transforms ,add both controllers in hands array,leave other things none and untick allowtoggleto2d also.
7.Last step is comment line no 279 -288 as we don't required for our current purpose.
Although my English is not so good but may be it help you.
Thanks,

FPS is fixed at a single position only

I am making a VR Game in Unity. But the problem is, after generating the apk and installing it in my phone, when I look through the cardboard my first person character is fixed at a single position only.
When I look at different directions, the fps arm remains at the same position, it doesn't rotate according to the direction I am facing.
I am using Unity Cardboard asset and I am working on Unity 5.
I've had a similar problem before, make sure that your model is a child of the Head Component, that way your model will be fixed to the head as it rotates.
EDIT
From the image you supplied in your question, you have the Unity Standard Asset FPS controller. This moves by mouse movement, which of course you cannot do on a phone. Because your arms are a child of the FPS Controller, they will only move if the mouse moves. Therefore you need to make your Arms a child of the Head component, like so:

Unity 3D with Vuforia AR: Adding a Gameobject to ARCamera View

I am using Unity3D with extension of Vuforia. I am working on Cylindrical targets. When ARCamera detects the image and starts the augmentation, I want to show my GameObject (.fbx file, imported into the Meshes folder and created a Prefab out of it) on the screen.
I am working in Unity C#.
I attached a script to the GameObject and initialized it DefaultTrackableEventHandler Script. When I run it in Unity and the camera starts, I don't see my object in the Game View. Whereas in Screen View, I see that bottle (Prefab) rotating.
make sure the camera, or the focal point has your object in sight, when i tried vuforia, rotate your card slowly 360° to see if you can see the object, also your object could be far above what you expect, I would recommend very long expanded cubes in the 3 axis, to get the reference in the augmented world, then move from there