I would like to make a basic game to practice some unity scripting. How can I add a new camera to my scene? I have created a cube as my main character and dragged a camera script from the store onto my cube but it says no cameras rendering.
what do you mean with "dragged a camera script from the store"
Instead, after you added your cube, select it and in the inspector (normally on the right side of your editor), click "add component" and type in "camera" and select the camera component
Related
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"
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,
I want to create a custom gizmo for camera in Unity - now I add CustomCamera script to gameobject with standard Camera existing.
For CustomCamera I can override OnDrawGizmos() function - but I need only one gizmo, not two (one for standard camera, and another for CustomCamera)
Also I don't want to collapse standard Camera component in the Inspector.
So, is there a way to switch off gizmo for a given Camera from script?
Here is the screenshot of what I want to do. There are 2 gizmos: linear gizmo for standard camera - and I want to hide it (red arrow), and spherical gizmo, drawn in OnDrawGizmos() function of CylindricalCamera - this gizmo is to be retained.
Two gizmos screenshot
If this is possible, I don't want to hide the stadnard camera from the Inspector, or collapse it in the Inspector.
Have a look at this: http://answers.unity3d.com/questions/515484/choosing-which-camera-draws-gizmos.html
You can use Camera.current in OnDrawGizmos to check which camera is currently rendered. Simply perform a check, if you want to render Gizmos with that specific camera (e.g. use tags or a Property in your camera script)
Edit
You can disable standard gizmos in the gizmos dropdown menu. For the camera uncheck the box next to camera. (See screenshot)
This is a follow up to this question regarding how to display objects on one camera only in google-vr and unity.
In the current demo project of Unity and Google-vr, I can only access Main Camera Left and Main Camera Right while running the game. During runtime, I am able to disable a layer with the culling mask of one camera.
But I am not able to save those changes while running the game. If I stop, the two Main Cameras Left/Right disappear and I only see Main Camera and GvrReticle as child.
I suspect the cameras are created or imported from a prefab during runtime.
What would be the right way to have the left / right cameras accessible when not running the screne?
It's mentioned in the guide:
Often you will wish to add the stereo rig to your scene in the Editor rather than at runtime. This allows you to tweak the default parameters of the various scripts provided in this plugin, and provides a framework on which to add additional scripts and objects, such as 3D user interface elements.
To turn your Camera into a stereo camera, select the Camera (or Cameras) in the Hierarchy panel, then execute the main menu command Component > Google VR > Update Stereo Cameras.
I'm learning Unity 5 and I have made simple game scene which has a coin and I wrote a code to collect a coin by first person character and when he walks towards the coin. So I dragged and dropped my code into coin layer in Hierarchy but to make this feature available I need to check the little checkbox of Is Trigger at my FPSController settings at the right side. The problem is Capsule Collider is shown at all and I really don't know why! There MUST be a section which is called Capsule Collider with Is Trigger option under the Audio Source. But as you can see ,it's not there & I don't know how to find it.. see my print screen
If it does not display in your Scene View, Enable it in the Gizmos by clicking on it.
Then under Built-in Components, make sure that Capsule Collider is selected. It show now show in the Scene View.
If it is not in the Inspector or not attached to your FPS Controller, add it by yourself.
Select the FPS Controller, Got to Component->Physics->Capsule Collider. You can then resize it.
You can add the Capsule Collider into your character yourself. All you have to do is select your character, scroll down the Inspector panel, click add component, search for Capsule Collider and select it.