#🥽┃virtual-reality
1 messages · Page 1 of 1 (latest)
Sounds good, But i am so new with this that I don't know what this all means, is there any post or something to be specific or just guide me please
BTW if you mean by going to Oculus > Tools > Create store-compatible AndroidManifest.xml , I already did that
Hey maybe this helps: The Android manifest is sort of an index or list of all of the parts of an Android app. You are getting an error because for whatever reason Unity is including the camera in the permissions that your app needs.
If you want to see what one looks like check this out: https://github.com/appium-boneyard/sample-code/blob/master/sample-code/apps/ToggleTest/AndroidManifest.xml -- your specific error is coming from an extraneous uses-permissions entry for camera like on line 10-12.
The manifest also normally includes a list of what 'Activities' an Android app includes, but for a Unity app there is just one. It includes other stuff like the app's name, configuration for deep linking..etc.
This page looks helpful for configuring manifests from within Unity... normally if you were making an Android app, you would just edit the file in a text editor, but Unity helps you generate it from a template that you can edit, as well as generating it based on your Player settings. https://docs.unity3d.com/Manual/android-manifest.html
(was that totally confusing?)
Maybe delete the manifest and make a new one. Or maybe quest manifest instead of store compatible?
Yes I did that, I replaced the manifest with the new one but still same error
Thanks for explaining I totally get it, you gave me enough material to read let me do my homework
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
<application android:label="@string/app_name" android:icon="@mipmap/app_icon" android:allowBackup="false">
<activity android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only" />
</application>
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
</manifest>
this is the manifest, oculus plugin generated for me, I don't see any permission over here
In the past I've used something like this to figure out what was actually ending up in the apk. https://stackoverflow.com/questions/4191762/how-to-view-androidmanifest-xml-from-apk-file
You are going to have to do a little bit of sleuthing.
Okay, so I followed your lead, I totally understand now that while building apk file unity modify manifest, so I decompiled after the build, changed the manifest and recompiled that fixed my problem but it still ask me to remove camera permission don't you think if I remove that I won't be able to look around in the app
Do you have il2cpp and 64 bit enabled in player settings @wet jewel
It also shows something sbout thay
And check for any camera checks, but don't think they are in settings for android
Yes I missed il2cpp and 64 bit while building in unity, will rebuild again, thanks
you probably already saw this: https://docs.unity3d.com/2022.1/Documentation/Manual/android-permissions-declare.html. I suspect what 'Oculus > Tools > create store-compatible manifest' does is create a manifest template. I'm surprised its not working. You might have luck creating one by hand. I've never done it. https://docs.unity3d.com/2022.1/Documentation/Manual/overriding-android-manifest.html#creating-a-template-android-manifest-file
(I doubt my google fu is any better than yours, but maybe those links help...)
hey im extremely new to unity and im trying to build a vr game for the quest. When it finishes building its not in the location i wanted specified and when i try to upload the file to sidequest it tells me that it doesnt exist. help.
Hi all, I’m trying to have the player in VR move to another location (or temporarily move camera) within the same scene using either a controller or UI button. This is to provide the player with a temporary top down perspective for reference (yes in VR i know!) and then return to the main.
I’ve made several attempts and approaches to doing this but my beginner skills have not managed to get anything working after countless hours youtube/googling maybe someone can point out the obvious or the right direction. So far my approaches have mostly been towards transforming the XR rig to a location or duplicating it in another location and creating a enable/disable switch for the two XR sets. One approach of transforming the xr rig ended up with my controllers disjointed from my camera view!
@dense roost Don't cross-post
sorry, I saw that in here noone was answering and forgot to remove the post
are you building it to android or desktop?
wdym?
im building the apk file to my desktop
have you tried the build and run or it does not work?
just those 2 errors?
yeah
strange, I usually get more when something doesnt work
what version of unity are you using?
2021.3.6f1
that's strange that trying to build for android in 2021.3.6f1 you don't get the gradle thing error. Guess they fixed it, but try this just in case: https://www.youtube.com/watch?v=RVtAD_q0Jtw
Unity 2021.3.6f1 and other Unity versions get the error when building to Android Devices:
"FileNotFoundException: Failed to find $C:/Program Files/Unity/Hub/Editor/2021.3.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\GradleTemplates\mainTemplate.gradle"
In this video, I will show you how to fix this issue to build to your Android.
Origin...
the thing that surprises me is that you dont get the "dilenotfoundexception: failed to..." error
did that solve it...? @covert ruin
no problem
If u use openxr, you dont need a head set. There is a simulator
Hello. Noob here. How would I script the input for a VR controller secondary button? Essentially I'm trying to do the same as the video below but with an XR controller in place of "Input.GetMouseButtonDown" https://youtu.be/xmhm5jGwonc?t=158
Hi everyone! 🙂 Today I will show how to teleport the player and other objects in Unity. I will also show why it sometimes won't work for your player character and how to fix it.
Learn C# here: https://www.youtube.com/watch?v=HB1aPYPPJ24&list=PL0eyrZgxdwhxD9HhtpuZV22KxEJAZ55X-&ab_channel=DaniKrossing
Download Unity here: https://unity3d.com/get-...
I also tried implementing with the XRI default input I have set up but the code did not work (again total beginner!)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class SnapTeleport : MonoBehaviour
{
public InputActionReference toggleReference = null;
private void Awake()
{
toggleReference.action.started += Toggle;
}
private void OnDestroy()
{
toggleReference.action.started -= Toggle;
}
private void Toggle(InputAction.CallbackContext context)
{
// grab current position = (assign) new position
gameObject.transform.position = new Vector3(1000f, 1000f, 1000f);
}
}
The above script with function (bottom) was assigned to a gameobject referencing XR secondary button
A couple of thoughts, the first item is not all controllers and headsets have a secondary button - so make sure you actually want to use it that way. Additionally, contrary to the XRI examples, some buttons (i.e. thumbstick) operates different for platforms as well. On some platforms (i.e. Pico) it operates as a 2D axis only, and on-touch will only work for other platforms (i.e. Quest and Vive). So, always aim for the simplest cross-platform input set. Additionally, a lot of the XRI input systems don't seem to work with certain platforms depending on your Unity version (i.e. not registering controller input for vive).
What you posted looks like it would work for whatever you configured the Action button to, provided that script is sitting on the XR rig base.
If you want to get deeper, create three scripts:
- XR2DInput
- XR3DInput
- XRButtonInput
And base on it InputFeatureUsage. That will let you pull any button, any movement, and any touch without going through XRI at all and decide what you want to do with.
Thanks for your help. I'll digest this and have a play around!
I built our XR framework using this as a starting point:
https://forum.unity.com/threads/any-example-of-the-new-2019-1-xr-input-system.629824/
I'm so excited to see there is a new XR input mapping system in 2019.1: https://docs.unity3d.com/2019.1/Documentation/Manual/xr_input.html
But haven't...
Hi, guyz can any1 tell me how to enable full screen for my app?
It runs by default in a windowed mode. I read that I have to go to the XR Plugin Management and set Oculus Quest support as marked. I did but it didn't help.
You also need a custom AndroidManifest
Describes required Android manifest settings for Oculus Quest and Oculus Quest 2 apps and games.
@buoyant jolt thank you for pointing that out ❤️. Do you know where can I find generated AndroidManifest? It should be under Temp/StagingArea but its not there. I know that I have to put edited one into the plugins but there is no place where I can copy it from so it can be merged well
The oculus plugin can generate one but
This will work for Oculus, and Pico
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal" android:versionName="1.0" android:versionCode="1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:theme="@style/UnityThemeSelector" android:icon="@drawable/app_icon" android:label="@string/app_name">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<meta-data android:name="pvr.app.type" android:value="vr" />
<meta-data android:name="com.oculus.intent.category.VR" android:value="vr_only" />
<meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2" />
<meta-data android:name="com.oculus.vr.focusaware" android:value="true"/>
</application>
<uses-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1" />
</manifest>
but I think I cannot just put it into the plugins, I have to change the values of Activities icons and other things so it can be merged properly. What I was thinking to do is to take generated one and just change one thing which is Full Screen option
You should be able to just name it AndroidManifest.xml, and store it under /Plugins/Android. Unity will merge it with any other AndroidManifest files during build time.
If you have a pre-modified one, just add the <meta-data android... specific entries
You'll need most of these specific settings, including AndroidTV support disabled (which can only be done in the Editor), in order to be able to submit it to Oculus. Some of the settings prevent it from even running in VR mode without them added.
The oculus process is very archaic.
still does not work for some reason.
My merged file looks like this:
I've set Full screen + added some flags according to documentation.
It is still running in a window lol
@buoyant jolt do you have maybe something else in mind that might cause the issue?
nope if the XR plugin is enabled, Android is enabled, Oculus is enabled in the XR plugin, and the manifest is in place, the build should show in VR mode @woeful sentinel
but that manifest seems to be missing com.oculus.vr.focusaware and android.hardware.vr.headtracking
Also, your manifest is enabling vulcan, which in some Unity versions is a black screen on the quest
ok now it works, honesty not sure how it happened.
I went through XR plugin management, I saw I have Oculus Disable (I had Oculus Support Enabled however), I enable it then, build failed, disabled and everything went through
anyway @buoyant jolt thank you so much for your help! ❤️ I would be struggling more now without your help!
Click on each error. More info will appear at the bottom on the errors
The screenshot itself just says the build failed because of 2 errors
Without looking to find more info there is no way to know what those are
how do i send it without flooding the chat?
cause i just started and i have a deadline tom
for my teacher
nice dog btw 🙂
Well, your teacher should be doing a better job and helping you. I know I work hard to make sure any students in my class have usable projects when I'm teaching. So that's on them, not you, in my opinion anyway
But that aside, one message says 2 errors occurred. So we gotta see what those errors say if we are to fix it
1: FileNotFoundException: Failed to find $D:/2021.3.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\GradleTemplates\mainTemplate.gradle
UnityEditor.Android.AndroidBuildPostprocessor.GetTemplate (System.String toolsPath, System.String fileName) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.AndroidBuildPostprocessor+<GetDataForBuildProgramFor>d__21.MoveNext () (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Modules.BeeBuildPostprocessor.SetupBeeDriver (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
I'm betting it's something small, a toggle switch for version or something
2: Build completed with a result of 'Failed' in 120 seconds (119509 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
3: UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <44a70d1b13cf47e29810e30f45ffae08>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <44a70d1b13cf47e29810e30f45ffae08>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
i hope so
Ok Hmm I haven't seen that error before. It's saying your untiy editor is missing a base template.
The FileNotFound is going to stop it from building
Yea i saw that weird..
My best guess, would be to install a newer 2021.3 with the Android systems. Backup the project or make sure it is checked into git or source control. And try and build it with a newer unity install. I suspect the Android runtime installed by your unity is broken.
It's possible browsing to the file will confirm if it is missing
if i change editor versions will that lose my project?
No, you can open the same project in different versions. Just make sure the first set of numbers match so it doesn't break anything
2021.3.f6
2021.3.f15 - safe update
2021.4.f1 - risky
2022.1.6 - extremely risky
just a reminder you can use threads to avoid flooding the chat.
alright sorry
What's wrong with a dozen posts in this chat? #🥽┃virtual-reality is often empty of conversation anyway, and it isn't like anyone needs to read it or gets notified.
rn im on 2021.3.6f1 which one should i change to?
I'd roll back just one version
LTS Release 2021.3.5f1
https://unity3d.com/unity/qa/lts-releases
As Unitys last batch of LTS releases had a lot of issues with android on our test machines
From the list I'd pick install via Hub, ensure it is 2021.3.5. and add the Android runtimes
alright finished downloading it
anddd it worked 🙂
How can I build the game and the screen display shows the right eye instead of the left one?
Does anybody knows how to set up Ready Player Me half body avatar with hand animation and all, I don't find any tutorial regarding to this
Another question, how to enable touchScreenkeyboard in VR while interacting with UI. I followed this thread but didn't worked for me https://stackoverflow.com/questions/68539289/how-do-i-enable-touch-keyboard-in-unity-vr
Did anyone here ever write VR handlebar controls? I tried figuring out the pure math, then went to physics joints and neither route has been very fruitful so far 😄 I'm looking to be able to grab either side and have the handlebar rotate to match the hand as much as possible while staying fixed position at the stem
Did anyone here ever write VR handlebar
Hi everyone. I'm trying to use the XR Interaction Toolkit and I've come across a strange UI bug where I have to aim either way above or way off to the side to click buttons. Has this happened to anyone else?
does anyone here have a steamvr unity plugin (player prefab, not camera rig) based gun interactable that actually works i could nab? been trying to make one both following tutorials and not and ive had no luck
Is anyone here using URP's decal render feature in VR? I'm testing on a quest 2 and simply adding the decal render feature tanks performance by like 40% (with no decals in the scene at all)
Technique is set to Screen Space, DBuffer doesn't seem to work (one eye no longer renders correctly)
Build Unity 2020.3.37f1
Opened new VR project template.
I'm trying to use the new input system for a VR project.
Added XR - XR Origin(Action-Based) to my scene.
Added the Starter Assets from the XR Interaction Toolkit.
I'm using the default XRI Default Input Actions provided from the sample.
Added the Input Action Manager script and added the XRI Default Input Actions(Input Action Asset) to it.
I also made a prefab of some cubes and added it to the Left and Right Controller Model Prefab so I can see the hands/controllers.
When I press play the hands/controllers move around uncontrollably once the headset looks at the controllers or when I pick them up. What would be the issue? Really new to Unity and VR.
@thick dragon It looks like maybe they are colliding with each other each frame. Do both the white cubes and red cubes have colliders, and is there a rigidbody involved? I would try removing all colliders from your cubes. It might not be your tracked hands freaking out, it might just be physics
@wintry delta Hi and thank you. There is not rigidbody involved with the camera and controllers. The red cubes or line where already part of the XR Origin when I added it. No rigidbody or collider listed in the inspector for them. I disabled/unchecked the box collider on the white cube. Also unchecked the XR Ray Interactor, Line Renderer and XR Interactor line visual. Played again and it is still the same issue.
Ah, right the red ones arent cubes. Theyre linerenderes. Hmm, I'm out of ideas then. Obviously your hands arent spazzing out outside of Unity?
Can we see the inspector for your hands, and children of your hands? I'm noticing zero rotation on either of them so perhaps something is off with the XR Controller (action based) settings
I'm talking about the objects under XR Origin called LeftHand Controller and RightHand Controller
I have a Oculus Rift S, so far I've only went to the home outside of the unity, no spazzing there. Sure one moment while I get a snip
I had issues with my Quest 2 hands not tracking at all because I installed both Oculus and OpenXR plugins under XR Plugin Management. Went away when I removed Oculus
Try removing oculus. I dont see any problems in your screenshots
Okay let me try it out
Okay I had both Oculus and OpenXR checked in XR Plug-In Manager. I unchecked Oculus but neither headset nor controllers move when only OpenXR is enabled. Checked only Oculus and the same issues persist with the spazzing controllers. Only Oculus, same issue. Only OpenXR enabled, no movement at all, not even camera moves.
I have limited experience with the new XR management stuff, so I'm out of ideas. Its a pretty old Unity version. My best suggestion would be to download the latest LTS from hub, and try a new project
Okay was a little confused with that, I was originally on 2020.3.33f1 and switched to 2020.3.37f1 thinking it was the latest one.
Okay I'll look for it what I have is 2021.3.2f1
Oh, wait. You kept saying 2020.x.x.x, now youre saying 2021.x.x.?
Make sure youre on 2021. Big difference from 2020
Okay and 2022 is not LTS yet correct? Sorry and thank you I will download 2021 and try it.
No, 2022 is still beta. Stay away from that one :p
Okay will do
Sorry for the confusion I have two 2020.x.x.x and 2021 installed. I was using 2020 this entire time lol
Try making a fresh project in the 2021 version and set everything up again.
@thick dragon Im curious did 2021 act differently?
Hey sorry for not updating you on it. I set everything up but I didn’t get any movement with the headset/camera and controllers. It was late and I didn’t have enough time to thoroughly test it. I am working now but I will test it again and make sure the oculus device is working once I get off in 8 hours. Thank you for reaching back
No worries 🙂 Hope it pans out
@wintry delta Thank you, hope so as well
i love this escalator asset, makes creating escalators quick n easy
If anyone else has had this problem I share my solution. The problem happened when I did the XR Origin update. For some reason a duplicate Tracked Pose Drive component was generated, this did not allow me to move around the environment and also amplified the rotational movements in all the axes of the head. The solution was to remove the duplicate item. I hope it helps others 🙂
That makes sense, I wasn't sure what a heat was, but now I see - head 😄
With my VR Unity Project if I wanted to make a Desktop Mode be able to launch from the same application what would I need to do to achieve it?
All we do is load the VR plugin via code
@wintry delta Hey sorry for the late reply, Unity is tracking headset movement but the controllers are not moving in 2021. Went to VRChat and testing that controllers and headset should be working fine
ah okay
No worries 🙂 Hope it pans out
I have a question, how do I get an interactable from a Socket Interactor, and then delete the interactable
every time I try to build my VR game it comes up with this error is there a way to fix it.
gonna have to click the above errors so we can see the full printout. You'll wanna know why gradle build failed. Also it only took 17 seconds so I doubt it got far
its realy long
Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\30.0.2\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-30\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.3.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :launcher:generateReleaseBuildConfig UP-TO-DATE
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :launcher:compileReleaseAidl NO-SOURCE
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :launcher:javaPreCompileRelease UP-TO-DATE
Task :launcher:generateReleaseResValues UP-TO-DATE
Task :unityLibrary:generateReleaseResValues UP-TO-DATE
Task :unityLibrary:generateReleaseResources UP-TO-DATE
Task :launcher:generateReleaseResources UP-TO-DATE
Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
Task :launcher:extractDeepLinksRelease UP-TO-DATE
Task :unityLibrary:packageReleaseResources UP-TO-DATE
Task :launcher:prepareLintJar UP-TO-DATE
Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE
Task :unityLibrary:processReleaseManifest UP-TO-DATE
Task :launcher:mergeReleaseResources UP-TO-DATE
Task :unityLibrary:compileReleaseLibraryResources UP-TO-DATE
Task :launcher:processReleaseManifest UP-TO-DATE
Task :launcher:mergeReleaseShaders UP-TO-DATE
Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
Task :launcher:checkReleaseDuplicateClasses UP-TO-DATE
Task :launcher:desugarReleaseFileDependencies UP-TO-DATE
Task :launcher:mergeExtDexRelease UP-TO-DATE
Task :unityLibrary:generateReleaseRFile UP-TO-DATE
Task :launcher:compileReleaseShaders NO-SOURCE
Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
Task :launcher:processReleaseResources UP-TO-DATE
Task :launcher:generateReleaseAssets UP-TO-DATE
Task :launcher:processReleaseJavaRes NO-SOURCE
Task :launcher:collectReleaseDependencies UP-TO-DATE
Task :launcher:sdkReleaseDependencyData UP-TO-DATE
Task :unityLibrary:compileReleaseJavaWithJavac UP-TO-DATE
Task :launcher:mergeReleaseJniLibFolders UP-TO-DATE
Task :unityLibrary:bundleLibCompileToJarRelease UP-TO-DATE
Task :launcher:validateSigningRelease UP-TO-DATE
Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
Task :unityLibrary:bundleLibRuntimeToJarRelease UP-TO-DATE
Task :unityLibrary:mergeReleaseShaders UP-TO-DATE
Task :launcher:compileReleaseJavaWithJavac UP-TO-DATE
Task :launcher:compileReleaseSources UP-TO-DATE
Task :unityLibrary:compileReleaseShaders NO-SOURCE
Task :unityLibrary:generateReleaseAssets UP-TO-DATE
Task :unityLibrary:packageReleaseAssets
Task :unityLibrary:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:bundleLibResRelease NO-SOURCE
Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
Task :unityLibrary:mergeReleaseNativeLibs UP-TO-DATE
Task :unityLibrary:stripReleaseDebugSymbols UP-TO-DATE
Task :unityLibrary:copyReleaseJniLibsProjectOnly UP-TO-DATE
Task :launcher:lintVitalRelease
Task :launcher:dexBuilderRelease UP-TO-DATE
Task :launcher:mergeDexRelease UP-TO-DATE
Task :launcher:mergeReleaseAssets
Task :launcher:mergeReleaseJavaResource UP-TO-DATE
Task :launcher:mergeReleaseNativeLibs FAILED
43 actionable tasks: 4 executed, 39 up-to-date
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
sorry its so long
wheres that
project> player settings
what should it be
23 or something? Not sure you probably wanna google it. Also I see projects with special characters often fail to build
so make sure the path doesnt have weird symbols
which unity version am I better off using if I want to develop unity VR applications right now? 2019.4.x, 2021.3.x, or something else? what considerations or rather pros/cons exist for those?
I'm aiming to target PC VR, such as HTC Vive, Valve Index, Oculus on PC. I'm less concerned about mobile/quest(1/2) support
Hey
I need to build a VR experience where there are 3 gb of videos, and these video need to be in the streaming asset folder (to acces them offline)
But when my obb is more than 2gb, i can't load my videos, any idea ?
does anyone know how to code it so that i can see cam 1 throw my oculus 2 and cam 2 throw my monitor
any idea why I cannot see the scene in oculus (using Oculus XR Plugin)? I can load into rift, but the scene just wont appear when I launch it?
@drifting echo
Definitely 2020.3LTS
It has the best compatibility and doesn't reply on legacy VR systems, so should be supported for a while (and easily upgraded in the future)
And it has the best performance for the quest. About 10-20% faster than 2021LTS (and also has spacewarp support with a custom URP).
The best one after that is 2021 lts
If you purely develop for PCVR (props to you) 2021LTS also will be fine. It offers faster IL2CPP build times and some more graphical improvements
@stoic storm updated unity to the latest version?
Otherwise maybe stream the video from online if possible?
What do you mean exactly? Black screen at launch? Both PC and quest?
Is enable xr on startup enables in XR settings?
thanks!
everything runs fine on PC, it just doesnt load onto Quest properly
And that setting? Is it on under the android tab of xr Management together with oculus?
it is
Have you tried disabling Vulcan support?
yeah
Sharing other player settings and the android tab of xr management with screenshots might help
Oh and if you use oculus integration asset, update it
that shpould be everything
@zenith pasture
You can try:
Linear color space
Set mono to il2cpp and enable arm64. This will be a huge performance win
maybe update to the altest version will work, but not sure
I cant put them online 😐
you mean when you Build it? did you selected the scene in the Build settings
Update on this, looks like it might be a vulkan specific issue. No performance drop using the decal render feature with OpenGLES. I should probably log a bug report I guess
Hi everyone, I'm having trouble accessing controller position data and the time that the data was last updated (for velocity calculations). I am using an ActionBasedController for this but the XRControllerState's time value is never updated (stays at 0). Anyone have any idea how to solve this problem?
No, when I simply enter play mode, I'm using oculus XR plugin
go into projectsettings scroll down to the xr settings and chicken on oculus
I can send you picture in 10 mins
that was it, thanks!
Hey, does anyone perhaps know how to open the native menu with the xr toolkit?
I want to trigger it via gamepad input but have not seen it yet in the API
Does anyone know how i can controll a player with vr? i found a free model which also can be used in vr but idk how
any vr script where on Collison something gets crafted or made
Do you mean the steamvr or oculus main menu?
If so, don't think this is possible
Ye that's what I meant.
Look for tutorials on YouTube. There are many
Think you're out of luck in that case
I see, thanks 🙂
i need help i cant find a steam vr gun or shootable script can someone help me
a question how to do when you want an action to be done when you move an object down or when you shake the controller very fast
Compare the distance between the current and past frame and invoke a UnityEvent when it's above a threshold
I'm using Unity 2021 LTS for quest, do you happen to have any resources or links that indicate there is a performance difference? I'm a bit concerned now that maybe I'll need to downgrade 😦
You can look for it on the forums under vr. Maybe scroll down a little.
Don't worry tho, if you are hitting your performance goals you can keep using 2021 just fine. I've also done some VR projects in it without issue.
If you want the absolute best performance and don't care about the new features 2020lts might be worth looking into, also because better SpaceWarp support if you're into that. If you use default or shadergraph shaders you should be able yo upgrade to 2021 later on quite easily
Hi. Should I activate GPU instancing in all materials or disable it please?
That depends on how many instances and your platform
There are cases where gpuinstancing is slower
oculus quest 2 is the platform, and they are static objects, maybe like 200 or more
Like, I'm currently getting around 50 fps and I need at least 72fps
Also, how can I know what is bottlenecking please?
like, how can I know what is causing the low framerate
I second staying at 2020, but I know a few studios running 2021 OK
Bottleneck : you can look at the Profiler on PC, and Oculus reports tips like render dock for the quest.
Overview of performance requirements and recommendations for Oculus Unity apps.
where can I find whether the player is using handtracking or controllers?
Use the profiler to see where the performance goes.
Finally got a bug report through about random black screens on vulkan!
Please vote on it to get it seen more:
https://issuetracker.unity3d.com/issues/oculus-quest-2-build-does-not-work-when-built-with-vulkan
Reproduction steps: 1. Open the user’s attached project 2. Go to Player Settings > Player > Android > Other Settings > G...
Hi! How can I build the game and the screen display shows the right eye instead of the left one?
So quick event question when working in VR. I'm working on a project with both a 2D and VR client. One of the things I'm working on involves a color picker screen that relies on getting a location from the object being clicked on. With 2D, that's easy, I can get the mouse position and convert it to something local. However with VR? I need to somehow get this location from an interacting raycast and I have no idea how to get the data of the raycast that triggered the event with the XR Interaction Toolkit. Anyone have any suggestions on where I can start?
can someone help me how i can animate my handwith a controller i can do it with trigger and grip from a tutorial but i want my thumb when i am on the prymaryTouch so i just have my finger on button but not pressed
this is how my trigger and my grip button works
and now idk how i can do it for the button a or b
i need avater etc but than i dont know how to code it right it doesent worked for me
Do you guys know how to connect Unity to Quest 2 without the Oculus PC app? My laptop doesn't support it unfortunately.
AFAIK you need Virtual Desktop
I saw somewhere you don't need a Oculus App to this
Hello, somebody can tell be what the fuck is happening?
I have one script which indicates to which controler script is embeded ( right / left )
And then sets keys for this controler
And rest of movement
This is my code:
// Grabbing
private Vector3 grabed = Vector3.zero;
private bool grabbing = false;
// Buttons
private OVRInput.Button IndexTrigger = 0;
private OVRInput.Button HandTrigger = 0;
// Hands
private GameObject RealHand;
private bool grab = false;
void Start()
{
Debug.Log(this.name.ToLower());
if (this.name.ToLower().Contains("right"))
{
IndexTrigger = OVRInput.Button.SecondaryIndexTrigger;
HandTrigger = OVRInput.Button.SecondaryHandTrigger;
RealHand = GameObject.Find("RightVirtual");
}
else
{
IndexTrigger = OVRInput.Button.PrimaryIndexTrigger;
HandTrigger = OVRInput.Button.PrimaryHandTrigger;
RealHand = GameObject.Find("LeftVirtual");
}
}
void Update()
{
OVRInput.Update();
if(RealHand == null)
{
Debug.Log("In " + gameObject + " real hand don't exist!!!");
return;
}
if (OVRInput.Get(IndexTrigger) && OVRInput.Get(HandTrigger)) {
grab = true;
}
else
{
grab = false;
}
if (grabbing)
{
Vector3 vec = Distance(transform.parent.parent.position, RealHand.transform.position);
Debug.Log( "What: " + gameObject + ", Range: " + vec);
Vector3 position = grabed + vec;
transform.parent.parent.position = position;
Debug.Log("What: " + gameObject + ", Where: " + position);
}
}
private void OnCollisionStay(Collision collision)
{
if (collision.collider.tag == "Grabable")
{
if (grab && !grabbing)
{
Debug.Log("Grabed");
grabed = transform.position;
grabbing = true;
}
if (grab)
{
Debug.Log("Grabing");
transform.position = grabed;
}
else
{
Debug.Log("Realased");
transform.position = transform.parent.position;
grabbing = false;
}
} else
{
grabbing = false;
}
}
private void OnCollisionExit(Collision collision)
{
transform.position = transform.parent.position;
}
private Vector3 Distance(Vector3 x, Vector3 y)
{
return new Vector3(x.x - y.x, x.y - y.y, x.z - y.z);
}```
Virtual desktop via steamvr works, but if your laptop cannot run the oculus software it most likely also won't run it in steamvr.
Then just build and run to the quest
Does anyone know how to delete an interactable from a Socket Interactor with a button press (Unity XR)
if no one can answer that, does anyone know how to make the Socket un-interactable when when an Interactable is in the socket
I'm trying to make a mag drop, I would like to delete the magazine on a button press, and then Instantiate the mag model alone so you can't reuse a magazine
So basically I have it so when I click the grip button on my vr controller(making for quest 2) it picks up an item and brings it to my hand.(I believe this is using xr grab interactables) I have another script for when I click on another object it changes a bit. This works alone and grabbing works alone, but when im holding an item it doesnt work. I have it so the line/raycast turns white when I can interact with it which it does normally, but when holding an item it doesnt turn white even though the raycast goes through and touchest that 2nd object. Any help would be greatly appreciated.
Not totally sure what a socket is but can’t you disable the box collider through script so they can’t pick it up anymore?
Hey, is playerController on it's own is enough to PREVENT the player from walking through the wall ??
do I need a collider and a script was it maybe ??
i dont have a headset right now to test it but when i drag the player by the player controler and push him toward the wall, I cant see any resistance!
switched computers but imported the whole project however it is not recognizing the oculus 2, if anyone could help thatd be awesome
How to reset the camera's z and x rotation when entering a portal in VR?
I just started unity a few weeks ago, and I have no coding experience. I've been grinding to learn 12 hours a day but I can't write/modify my first script.
I got the base of my game off Github, and I managed to integrate VR into it by installing the necessary prerequisites. Now the game has a script called "RigidbodyCharacterController" which contains movement info and camera rotation for when you enter a horizontally placed portal. The issue is that it doesn't work in VR, contains useless movement info, and it's buggy, so i got rid of it. Now I just need a script that can reset the camera's z and x rotation axis each time I enter a portal.
here's the old script:
https://gist.github.com/Lego-Dimensions/2898bf1d27f86e2d3ad770f799629777
here's the BasicPortal gameobject + components:
https://i.stack.imgur.com/ES0mb.png
here's the rest of BasicPortal components:
https://i.stack.imgur.com/oHuD1.png
Installer xr management and XR Interaction Toolkit?
@warped grotto
Follow guides or the unity learn path for VR
guysss
any help with that ??
i'd help you if you'd help me
i usually help when I could without a reason but what is ur problem?
read above
scroll up
i need to reset the camera's x and z rotation once every OnEnterPortal call
i have a headset and i can help you
I dont think anyone could help you with that
1 - we have no idea what project u are working on
2 - OnEnterPortal is a custom function , only u know what it does
3 - we dont know what do you mean by " reset "
the list goes on and on ... I think this one is something u have to figure out on ur own
i bought a headset, I will test it later 😄
Iirc make a public gameobject for your camera(ill call it camera1)
Then do
camera1.transform.eulerAngles = new Vector3(
camera1.transform.eulerAngles.x,
camera1.transform.eulerAngles.y,
camera1.transform.eulerAngles.z
);
Thatll be used to set the values you want
I think that would work
Lmk if it doesnt though
yeah, i'm dumb so i don't know how to set it up, would you mind sending (not partially) the whole script ? i told you i'm new to coding.
by reset do you mean 0, 0, 0?
public GameObject camera;
Vector3 target;
target.x = transform.parent.eulerAngles.x;
target.z = transform.parent.eulerAngles.y;
transform.rotation = Quaternion.Euler(target);
maybe that?
(don't forget to set the camera as the gameobject in unity itself
not sure then sorry
https://youtu.be/WTskOXhE4zc this is what i mean by rotation
i need to have the camera rotate back to how it was by the time you get out of the vertical portal in the video shown
if someone helps, i'll be eternally grateful
Hi! How can I build the game and the screen display shows the right eye instead of the left one?
go on the camare and click than in the cam settings right eye
idk, I use the Ultimate XR that is pretty new but is awesome in my opinion, because is really well documented (and free😅 )
so i tried this tutorial https://youtu.be/VG8hLKyTiJQ for making physic hands but when i try it the hands rotate i followed the whole tutorial footage:
Just at the end of the video it says that problem will be solved in the next video I think
About the hand pickup not the hand rotation thing he had no problem with that
He would make a vid3o about picking stuff up with dat system
no idea then. Maybe you have to add some angular drag to the rigidbody or remove some drag, idk
Hi, I'm trying to do a Main Menu, but can't click any buttons. I have a XR Ray Interactor on each Controller, selected 'Hover to select' and have Eventsystem with a 'XR UI Input Module' script. Does somebody have an idea how to make it work? I am really new to VR..
Check the Unity Learn VR section
Get the position of the bar and move your self
I have familliar problem
BTW I will ask again
Somebody knows why the right hand didn't works?
I can gram things with two hands
But move only with one
// Grabbing
private Vector3 grabed = Vector3.zero;
private bool grabbing = false;
// Buttons
private OVRInput.Button IndexTrigger = 0;
private OVRInput.Button HandTrigger = 0;
// Hands
private GameObject RealHand;
private bool grab = false;
void Start()
{
Debug.Log(this.name.ToLower());
if (this.name.ToLower().Contains("right"))
{
IndexTrigger = OVRInput.Button.SecondaryIndexTrigger;
HandTrigger = OVRInput.Button.SecondaryHandTrigger;
RealHand = GameObject.Find("RightVirtual");
}
else
{
IndexTrigger = OVRInput.Button.PrimaryIndexTrigger;
HandTrigger = OVRInput.Button.PrimaryHandTrigger;
RealHand = GameObject.Find("LeftVirtual");
}
}
void Update()
{
OVRInput.Update();
if(RealHand == null)
{
Debug.Log("In " + gameObject + " real hand dosen't exist!!!");
return;
}
if (OVRInput.Get(IndexTrigger) && OVRInput.Get(HandTrigger)) {
grab = true;
}
else
{
grab = false;
}
if (grabbing)
{
Vector3 vec = Distance(transform.parent.parent.position, RealHand.transform.position);
Vector3 position = grabed + vec;
transform.parent.parent.position = position;
}
}
private void OnCollisionStay(Collision collision)
{
if (collision.collider.tag == "Grabable")
{
if (grab && !grabbing)
{
Debug.Log("Grabed");
grabed = transform.position;
grabbing = true;
}
if (grab)
{
Debug.Log("Grabing");
transform.position = grabed;
}
else
{
Debug.Log("Realased");
transform.position = transform.parent.position;
grabbing = false;
}
} else
{
grabbing = false;
}
}
private Vector3 Distance(Vector3 x, Vector3 y)
{
return new Vector3(x.x - y.x, x.y - y.y, x.z - y.z);
}
Right controller works in the other way than left?
Anyone?
Hi. Anyone knows why if I remove from the head the oculus quest 2 in the unity editor the tracking pause (and from the lenses I see a black screen), while from build it doesn't happen (and I see the scene image in the lenses)?
IDK, when I test games mine or not mine then always is a black screen and stop tracking when I remove HMD
You run your build on PC or Quest 2?
I run in Quest2... I noticed that in the build the oculus pauses after 30/40 seconds, while in the editor the effect is immediate. Maybe i need to change some settings?
i cant select anything
hi! I've been having a camera issue that I can't quite seem to figure out. For whatever reason, my view is inverted, and everything is appearing incorrectly through the lenses. It's like the field of view is off and moving my head causes the player to look in the wrong direction. I'm thinking it is some sort of problem with a setting, since the rig I have works perfectly fine in other projects, and I was just wondering if anyone might know if I pressed a button I shouldn't have, or something like that
if anyone knows what's happening, please ping me. Thanks!
Okay so, I have a VR Scene, and if i use both rigidbody (for physics) and character controller at the same time, gravity will refuse to work and instead goes flying into the sky.. what should i do? if i remove Character Controller the player works normally but then there's no wall collision. should i create a script for wall collision, and remove Character Controller? ping me if you answer!
Answer to my Question. You have to move your player by RB or CC
How do you create project?
Do you use a Unity VR template?
You can do movement and collisions ( without CC ) via RB or you can just disable/remove rb ( if isn't necessary ) and do a: GetComponent<CharacterController>().Move(fall * Time.deltaTime * speed);
If just need a falling then the option with CC supposed to be easy
how would i do wall collision with RB?
i'm lost
You want to collide with for e.g wall, yes?
yea
yeah i use Capsule Collider
And that's it
weird.. cause i can go right through walls
can i screen share with you so i can show you?
via discord
Can you record it? And give us a link on yt for .eg
it's just a hollow made in a voxel software
Try to add a unity cube
With collider
If this will work then this is problem with walls
can you empty the cube on the inside and make it an empty room by scaling it up?
AFAIK no
alright
Because on empty cubes collisions dont work
i'll let you know
when i'm done
nope, i recreated the hollow with cubes only with box colliders and still the only thing that collides with the player is the floor
@hasty moss
Can you send a screen shot in good quality?
Inspector of player and to cube
and the floor
No I used the universal render pipeline and imported the XR toolkit
I think it’s some mistake I made recently, but a deeply rooted one. I say that because it was working fine up until this morning, so whatever I did as a mistake is probably a simple misclick somewhere
You can copy objects from VR template and put them to your project
I know. The problem doesn’t really lie in the XR rig I’m using though. It actually works fine in other projects. It’s this specific one. Worst come to worst I can easily transfer everything to a new project, but my worry is this happening again in the future when I’ve added more stuff to the game
Can't get it to work. Anyone able to help?
after searching the entire day, I found the issue and I feel like an IDIOT. Apparently, last night I added a camera to one of my tree objects, causing it to be the main camera and project everything from that tree in a weird field of view. My headset is dead right now, but in the morning I'll confirm to make sure that was the only problem.
Maybe raycasting is blocking by collison of that object
And object as a child and then off collider
Hi! How can I build the game and the screen display shows the right eye instead of the left one?
Try change this in the edytor
Editor*
Or as far as I remember in camera options it was
To choose primary eye
sorry for not coming back yesterday,
fortunately, i think i found the solution, my rigidbody had Freeze Position Checked on X and Z axis, i unchecked it , and i had wall collision!!
but that also comes with a few more issues, the collider slides around the player and i can't seem to figure out the cause. by sliding i mean that it doesn't stay on the player it goes in random directions around the player
do you have any idea what's happening?
or do you need a video
I need a screen shot of a tree
|| If I won’t respond then this mean I have forced nap ||
are you joking or is it some sort of unity thingy
i don't see why you need that but here it is.
I need to know which object have your player collider
Camera Offset, i tried placing it on XR Origin, but the gameobject with the Collider needs the "Teleportable" script with it too, when i place the "Teleportable" Script on the XR Origin, Inputs and Controller Tracking will refuse to work
the "Teleportable" script tells the game that this gameobject is going to walk through the portals
To make sure you aren't parenting something in a weird way at a position offset causing it to spin at a weird point
How do you move with your player? This can be the case what I had
with the locomotion script
system*
RB ( Rigidbody ), CC ( Character Controller ), TP ( Transform.Position )?
i'm staring at your message and i can't seem to understand what you mean
You can move your via rigidbody with for. E.g addforce
You can use character controller and use move
And you can change position of player by setting transform.position
You can send code what is in that script
if i use CC i won't have gravity unless i use RB too
let me post the script on a website since it's too long
it's my first time using this website, can you see the code?
https://hastepaste.com/view/okMXJiaPD
|| You can just do a endless constant move in transform.down - good for non parkour game ||
Yea, I see
so if i put this script on XROrigin (GameObject)
(with/without CC)
my controllers won't track
At all?
yeah, will not move from the 0, 0, 0 position
i even tried dragging XR Origin into an Empty Gameobject and putting the script on the empty gameobject instead, same result
Fast test do a new script with only CC movement, buttons checking and attach it to Origin. Enable CC and disable RB
Then we will be know if Unity see the controller
BTW disabled the other movement script
on which, CameraOffset or XR Origin?
XR Origin
BTW as far as I remember the hands don’t suppose to be childs of camera/camera offset
If test with CC won’t work then I take a nap to refresh my mind.
sounds good
it's kind of embarassing to remind you about this but... i don't know how to write scripts, i'm still in my first month of unity.. so you can rather write it yourself or take that nap, i'll wait either way 🙂
If you want to try by yourself then check this 😉
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
BTW you work on Oculus, right?
Ok, so when I will wake up I will send you my movement script to test
public float fall = 1.5f;
[...]
GetComponent<CharacterController>().Move(fall * Time.deltaTime * speed);
AHHH
For now to chceck if movement works
thanks
This is your own "gravity"
where do i place that? into a new script or specifically existing one?
New script
👍
And disabe existing for a moment
how was your nap?
Good 4 hours
void Update or void Start()?
let me be more clear, where do i place this
GetComponent<CharacterController>().Move(fall* Time.deltaTime* speed);
Update
good
Anywhere in Update
The name 'speed' does not exist in the current context
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DiscordScript : MonoBehaviour
{
public float fall = 1.5f;
void Update()
{
GetComponent<CharacterController>().Move(fall * Time.deltaTime * speed);
}
}
Oh, right, I didn't saw this
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DiscordScript : MonoBehaviour
{
public float speed = 1.5f;
void Update()
{
GetComponent<CharacterController>().Move(-transform.up * Time.deltaTime * speed);
}
}```
I need to wake up XD
don't worry man
This supposed to be -transform.up
oh yeah, sorry
it's done
what do i do now?
i still can't test because the controllers still won't track
You enabled a CC?
yeah?
Then go in editor and drag your player object up
Wait, we want to bake a movement and to collider not slide, right?
yes! but at the same time i want Teleportable to work too
This script had to test if collider works good when object falling without additional script than CC movement
like i said, that enables me to go through portals.. without it i can't do my project
This change your position rapidly or you can be half in portal?
Ok
okay.. gravity works! but the collider still has the wrong offset, look where the player is vs where the collider is
@hasty moss
Collider is atached to ofset?
yes, like i said if i place it on XR Rig it will also need Teleportation Script to teleport which blocks the controller tracking
Colider have center on 0?
Oh, right XD
i also have this script which doesn't seem to do it's job
using System.Collections;
using System.Collections.Generic;
using Unity.XR.CoreUtils;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class CharacterControllerDriver2 : MonoBehaviour
{
private XROrigin xROrigin;
private CharacterController characterController;
private CharacterControllerDriver driver;
void Start()
{
xROrigin = GetComponent<XROrigin>();
characterController = GetComponent<CharacterController>();
driver = GetComponent<CharacterControllerDriver>();
}
// Update is called once per frame
void Update()
{
UpdateCharacterController();
}
/// <summary>
/// Updates the <see cref="CharacterController.height"/> and <see cref="CharacterController.center"/>
/// based on the camera's position.
/// </summary>
protected virtual void UpdateCharacterController()
{
if (xROrigin == null || characterController == null)
return;
var height = Mathf.Clamp(xROrigin.CameraInOriginSpaceHeight, driver.minHeight, driver.maxHeight);
Vector3 center = xROrigin.CameraInOriginSpacePos;
center.y = height / 2f + characterController.skinWidth;
characterController.height = height;
characterController.center = center;
}
}
it should carry the CC based on the location in the real world
but i guess it's because i don't have the xr rig component in the CameraOffset gameobject
either way, is there any way i can replace the xr rig from the script above with something else?
like the cam?
i'm doing this because i think the CC doesn't move with the real world location, like if i move my head to right, it stays in place
hence the collider offset not being where the player is
If you use a tranform.direction
Then this movement is frelative
thanks for taking your time btw, it really means so much to me!
without you, the project will be incomplete
so what do i change in the script that i sent above?
i tried using OVR but the locomotion seemed too complicated so i returned to XR
can you guide me?
Yea, I think so
so i dragged the OVRPlayerController from the Oculus>VR>Prefabs into my scene
i disabled XR Origin
alright, so how do i do locomotion?
Wait
yeah?
Yea, my grabbing script and movement
Erase Virtual objects
And on this base try to work with controllers
Supposed to work every time
wdym "Virtual objects"?
From where it is?
the old one
the current one just has Camera Offset
i deleted the missing script
Then no. BTW I recommend you workin in new project to don't mess up anything
i got backup
with the teleportable script in it?
For now no
just CC?
are you sure it's supposed to be just CameraOffset in the XRRig?
i feel weird deleting that missing script
what if it was the Rig itself
AFAIK Camera offset is your head
And the Right controler and Left controler are hands
alright
Send a SS of hierarchy
Ok, and to see if you are moving hands
Add a cubes
to right and left controler
and run the game
i added the portal gun in the right
walking with analog
i'm not sure teleporting even works with portals
like locomotion teleporting,
would be a weird mechanic for this case
so walking with analog is the way now
Vector2 move = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick);
GetComponent<CharacterController>().Move( (transform.forward * move.y) * Time.deltaTime * speed );
Try this
For walking forward and backwards
new script?
wait, you mean in the XRRig?
'speed' does not exist in the current context
@hasty moss
Vector3?
Float
yes
You move your analog to the top?
every possible way
both of them
yes i tried
i think it doesn't receive my input
To test it
Do this
if (OVRInput.Get(OVRInput.Button.One))
{
Debug.Log("I work - A button");
}
If this won't work then i reccomend a donwload Oculus packet
And set it in options
which options?
Project Settings or Preferences
i have downloaded the Oculus Plugin
i mean i already had it
So this dont work?
Yes
it doesn't
i pressed the A button and it doesn't appear
i tried all of the other buttons too
Wait,I forgot about
OVRInput.Update();
Use it in update
On the first line
In scripts where you are using OVR
Movement too?
the movement works, back and forwards
Relativly?
You can fight with speed later
Add a:
GetComponent<CharacterController>().Move( (transform.right * move.x) * Time.deltaTime * speed );
```next
works
got a problem though, the movement should update the direction i'm walking by the direction i'm looking, (if you know what i mean), but it isn't such a big problem.
like forward should be in the direction i'm looking only
anyways let's do rotation
if you want
i know, but this is a (?)hard(?) problem ( in my unity environment ) because this you have to get a camera rotation in Y
let's do rotation shall we?
Okey, BTW I will try to write answer to movement
BTW don't add a up-down rotation
Because this will be sick
To this
okay
i probably did everything wrong but here's what i did
void Update()
{
OVRInput.Update();
Vector2 move = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick);
Vector2 rotate = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick);
GetComponent<CharacterController>().Move((transform.forward * move.y) * Time.deltaTime * speed );
GetComponent<CharacterController>().Move((transform.right * move.x) * Time.deltaTime * speed);
GetComponent<CharacterController>().(transform.Rotate(transform.right * rotate.y) * Time.deltaTime * rotate);
}
correct me
when i told you i'm terrible at this, this is what i meant ⬆️
GetComponent<CharacterController>().Move( (transform.forward * move.y) * Time.deltaTime * speed );
GetComponent<CharacterController>().Move( (transform.right * move.x) * Time.deltaTime * speed );
transform.Rotate(transform.right * rotate.x);
😉
and sorry for being stupid
👍
works with up
and what now?
i'ts 3:22 am here so i probably need to go soon unless i get it to work 👀
In my area is 02:24
What do you want to add now?
You can try
shoot, i hope this works
ragdolls + vr = dopamine
But you don’t use a VR
Hello In need of some teammates for developing a VR project that has won a prize from Oxford University. If you are interested plz contact
Can you give more info for people?
What skill do you need?
On what level?
Any additional languages?
InputOVR hands and controller missing. Any fix?
Unity VR template?
And whats wrong?
Scale cube by Vector3.Distance
Hello.
I don't know if i am in the correct place (and if i can ask for this)!!!
We are working on a multiplayer project in "Unity". We are using "OpenXR" and for the multiplayer part we use "Fishnet".
We did not find videos or tutorials that work with this "software", the "Fishnet" community is still small and all the tutorials I have found use "Photon Pun", which is totally different from "Fishnet".
Does anyone have any tutorials/examples that work with "XR" and "Fishnet"?
Thanks a lot.
Why doesn't fishnet work for you?
XR does not change how networking behaves
Nice
do you know if i'm allowed to post the demo on Side Quest?
saying it because it's just a free github project converted to VR
but i'm also thinking at the thousands of kids waiting for a portal game on the platform
.
IDK
Pobably yes
Hi! How can I build the game and the screen display shows the right eye instead of the left one?
In the "Target Eye" it only gives me these 2 options
What unity version and do you use custom shaders?
hey man, i got an issue if i play more then around 3-5 minutes the blue portal won't shoot
can you check the "SpawnPortalOnClick" script for me?
Hi again!
I'm using Unity 2021.2.19f1
And, I don't think I'm using custom shaders(how do I check if I am?)
Okey
If you don't know you probably don't. You can check on your materials.
Maybe try the latest 2021 lts, this version is quite old @brazen tundra
Yea thats what I think but how do I fix this? As far as I can tell the xr grabbing thing just makes it go to the object, not parent it
im not sure tbh
if you could help me that would be awesome but idk xr grab interactable works :(
I also have another question, in xr grab interactable select is for the trigger and activate is for both, how do I check for JUST the grip?(side button)
my only idea was to instead of xr grab interactables would be to create my own script which would parent the object to the hand and disable the collider like you said
but like I said before idk how to check for those buttons
What is XR grab?
A think part of xr that auto grabs for you when you hit buttons it auto goes to your hand and stuff
This is prescripted in Unity?
Or this is some package?
|| I write all my solutions by myself 😅 ||
@hasty moss , could you help me with writing a script for updating the collider's position based on the camera's?
because i can peak my head through walls
Either implement something similar to the video below, or simply make the screen fade to black when putting your head in a collider
The XR Interaction Toolkit provides a very easy to set up locomotion system, BUT players can easily cheat by walking through walls. In this video I'll show you how to prevent that from happening!
// 🎓 UPCOMING VR COURSE
https://www.vrcreatorpro.com
// 🦸♀️ GET THE SOURCE PROJECT (by supporting me on Patreon!)
https://www.patreon.com/JustinPBar...
Today I'm busy
👍
finished following that video, but i'm not using Character Controller, instead i'm using Capsule Collider with RigidBody, mind helping me switch that?
and no, my project doesn't work with CC
using System.Collections;
using System.Collections.Generic;
using Unity.XR.CoreUtils;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class CharacterControllerDriver2 : MonoBehaviour
{
public CharacterController _character;
public XROrigin _xrOrigin;
void Start()
{
_character = GetComponent<CharacterController>();
_xrOrigin = GetComponent<XROrigin>();
}
// Update is called once per frame
void FixedUpdate()
{
_character.height = _xrOrigin.CameraInOriginSpaceHeight + 0.15f;
var centerPoint = transform.InverseTransformPoint(_xrOrigin.Camera.transform.position);
_character.center = new Vector3(
centerPoint.x,
_character.height / 2 + _character.skinWidth,
centerPoint.z);
_character.Move(new Vector3(0.001f, -0.001f, 0.001f));
_character.Move(new Vector3(-0.001f, -0.001f, -0.001f));
}
}
this is the code
i need to switch the Character Controller to Capsule Collider smhow
Personally haven't finished it.
You are probably using a rigidbody for movement. Use that instead of CC
i'm still in my first month of unity so it's pretty rough for me to write scripts
Then simply fade the screen when in a collider. Definitely easier
Otherwise google how to move a rigidbody in this way
Okay... i see
i can't find anything on google
i searched every single possible term
i just need the Capsule Collider to follow my camera, why does it have to be so complicated?
There is no rigidbody on the player somewhere?
If so, how do you move the player?
There also needs to be a rigidbody to have collision in the first place
yes there is
there is rigidbody obviously
@north path
but idk how to write the script
Online there are many guides for rigidbodies. If it's too hard get back to it later.
Don't have time to write scripts for everyone (sadly)
OpenXR action based controllers stop working when Oculus Integration is used:(
The only solution is to disable Oculus Integration..but then we can't access Oculus platform functions
What oculus functions do you use?
Don't you have to include Oculus Integration to submit to the store?
You just need a store compatible androidmanifest file (for app lab at least, but probably also for the store)
Generate it in a separate project and then copy it over :p
@cyan sky
Hmm..that's interesting..but still unable to access platform features, such as friends, achievements, etc.
Thank you!
Those probably need oculus integration yes. Does just having the oculus integration cause the issue?
Maybe make a forum post explaining the issue in more detail. Bit more organized than this
Package I believe
It also moved the hands and stuff but thats a dif xr script
I think ik how to if you can help me with the button stuff
Whats openvr? Another thing for hands?
It's a known issue:/ ..I was just hoping there was some sort of a workaround
Reproduction steps: 1. Open the attached project (Oculus Integration.zip) 2. Install the official "Oculus Integration" package from ...
The latest version of OpenXR works, but the controllers loose tracking if you enable the latest Oculus Integration
Wait you can test vr stuff in unity itself?
The input still works, but the controllers are stuck to the floor
Yes
Yea, for inputs And other Quest study
@north path Hi! Hope you are well! I updated to the Unity Version 2021.3.6f1, however I still don't have an option to select the eye. Does your give you an option?
Bruh wish I knew lmao
Ok cool
Do you think you can help me switch later
Yea
Cool tysm <333
Yea. I’m out side
can you ping me when you're home?
IDK if I don’t go straight to sleep
Can you remember me with what do you have problem now?
sure
Maybe I think something up
i just need the rigidbody/capsule collider to follow the camera/real world position so i can't get my head into walls
You can add a second collider to your camera
Or do a script that if distance between face and wall is for e.g 1 then you have black screen. ( You can later change it into fading)
no, that will break my portals, i don't want black screen when entering portals
Cant you add trigers to your walls with labels(forgot what they are called) and then check if its a wall then go black or whatever
i don't have that kind of portals, i can place portals anywhere, they're not static
Yea but if the label is only on your wall would that affect it as long as you have the portal collider come out a bit?
yeah you're right, i just think that the rigidbody/capsule collider following the camera is way more convienent
You mean tag?
I don’t see a reason for that
Can you explain why do you want to do that that way?
I mean why rigidbody. As far as I understood you want to make screen black when HMD is too far from body
i don't want to reset view every single time because i end up in walls
i want rigidbody/capsuleCollider to follow the camera
I have an idea, but wait - I will test it first
Yea
@hasty moss would you be able to help me transfer to that other one you use now?
Remember me what you want to achieve
my raycast doesnt go through an object I want and the only thing I thought of was a custom script but I didn't know how to register the grip/side button so I was going to transfer to the hand controller you use so I could get some assistance from you
I will send you for a moment a prefab
There you have a name of buttons:
The Unity Manual helps you learn and use the Unity engine. With the Unity engine you can create 2D and 3D games, apps and experiences.
BTW You do it for/on Quest?
thats for a dif controller than quest 2 though I think
wdym
because wont I also need packaxes and to get rid of my old one and transfer stuff to the new one
You create program from template for VR or how?
the 3d game one
No
Look below
Touch Controller
I started this during a vr game camp and this is waht they told me to do but id be fine with completely switching
yea those are different
Oh nvm lol
just sideways xD
mb
VR template have a very nice “player” model
Because you have already movement for Headset and controllers - and then you only connect OpenVr as a Oculus inputs
I guess
Would it be ok if I dmed you? or want me to just stay here
wdym
Here. I try to show people here that somebody cares about that channel XD
Lmao ok
Player in template can be different than yours what you have now
Oh, okey
You can't just simply move player with your camera?
Script for the highest element: and there in update transform.position = new (child.x, transform.position.y, child.z)
i have this odd problem where my Draw Calls, Polys and everything is Optimized
but my game still lags a crap ton when its built to Quest 2
and i cannot figure out why
What unity version?
Multiview?
Define optimized, what are the stats?
What does the profiler say?
Any info about the actual performance?
@tight geode
Unity 2021.3.6f1
i am not sure what multiview means
For both Eyes: 180 Draw Calls, 500K Tris
Frame Debugger says 180 Draw Calls and everything in the Scene is about 200K Tris more or less
Even if i turn off a bunch of stuff like Lighting or any Fancy Effect it still stays at under 20-25FPS
Im convinced my Project is glitched or something because i cant figure this out
Where do i do that?
Left part of the bar
There you have a “overlay”(?)
And right up corner you have settings
And there you can browse
And see quality
https://youtube.com/playlist?list=PLjnZTAR0BuTDNeDPy44G4bUpYRHGzy_xh
Also might be helpful for you.
But use the profiler as well to see where the issue is
( IDK if this is only to set by oculus app )
@north path just realized i am using Multiview yes
@hasty moss how do I add openvr? The virtual reality supported thing at the bottom isnt here lol
The Unity Manual helps you learn and use the Unity engine. With the Unity engine you can create 2D and 3D games, apps and experiences.
This will add OpenVR to your project
Im using openxr and when I use hand models (from oculus if it matters) they are at the top of the controller and not like the controller is this normal? if so how can I fix it I tried offsetting it it was really weird
nvm legit just fixed it self
i still haven't figure it out, i'm about to give up on it @hasty moss
You still have a problem with a scale-room, right?
Wait, I will find way for you
I have idea how to do it
thanks man.. you're my last hope
|| Offtop: you know how to configure a PyCharm? XD ||
||i don't even know what is that||
|| OW XD PyCharm is an Python IDE. I ask because a do a FBT with 1/2 web cameras in Python and transfer it to Unity ||
i'm not the person you can talk to about this lmao
i just began unity and you're asking me about python
XD
@wintry fiber I test it and... you have to do nothing to have a room-scale game
But if your headset don't move with you
you can force it
in XRRig -> Debug -> CameraOffset -> Tracking Space
IDK if someone from here can do it
noo, that's not what i meant..
what i meant was, i need my collider to move with my headset
Oke, wait
Set camera pos as cc center
i don't have CC i have rigidbody
this is the code i found relevant:
using System.Collections;
using System.Collections.Generic;
using Unity.XR.CoreUtils;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class CharacterControllerDriver2 : MonoBehaviour
{
public CharacterController _character;
public XROrigin _xrOrigin;
void Start()
{
_character = GetComponent<CharacterController>();
_xrOrigin = GetComponent<XROrigin>();
}
// Update is called once per frame
void FixedUpdate()
{
_character.height = _xrOrigin.CameraInOriginSpaceHeight + 0.15f;
var centerPoint = transform.InverseTransformPoint(_xrOrigin.Camera.transform.position);
_character.center = new Vector3(
centerPoint.x,
_character.height / 2 + _character.skinWidth,
centerPoint.z);
_character.Move(new Vector3(0.001f, -0.001f, 0.001f));
_character.Move(new Vector3(-0.001f, -0.001f, -0.001f));
}
}
but i don't know how to convert it to Rigidbody and Capsule Collider
@hasty moss
BTW why you can't add collider to your head?
i don't think it works
i need to carry the existing one with me
This is one room at once level, right?
You have only one room in one level?
So I think you can exit your body
I mean the XRRig will stand in place
And you will move with headset with colider
yeah
Hello to all. Does anyone know if it is possible to get the value of the proximity sensor placed in the middle of the lenses of the oculus quest 2? need it to immediately understand when the user has removed the viewer. Thank you.
I guess it supposed to help
in openxr is it possible to call the object inside of a socket interactor?
IDK
But maybe this will help you
This video explores the use of Unitys XR Interaction Toolkits, socket interactors. Socket Interactors allow the player to 'snap' objects to a specific location.
sword model used! Thanks to LowSeb!
link: https://sketchfab.com/3d-models/medieval-sword-da574cba504e4b83a3293f3d3bd067fb
License: https://creativecommons.org/licenses/by/4.0/legalcode...
I tried it didnt really help
BTW I don't understand this part "to call the object inside of a socket interactor?"
Can you explain this
Interesting, thank you. Have you ever used this class? It seems to me that it refers to mobile devices, tho.
No, I didn't use that
BTW Quest's don't go into sleep mode after you remove it?
like I just need the object which is inside the socket its transform
Yes, after 15 seconds I removed it. But because I'm in multiplayer, I need to do something as soon as the hmd is removed.
You want to set your item in hand when you grab it?
I saw this that game freeze after headset is removed
So if it's multiplayer game, then you can for e.g kick player when he don't respond
Wait
Look at this
ok lemme explaain what I wanna do: I have a socket which is like in a belt then when an object is in the belt I want to scale it down so it'll look better
I don't want to kick off. I just want to know when he takes off his HMD to stop tracking his movement.
Look at this link
Like in phasmophobia?
Already seen. Unfortunately I don't use OVRManager. In addition, all the events like this one I have tried seem to be generated when the oculus goes into sleep mode and not when the user takes off his HMD.
I didnt play phasmophobia but from gameplay I just found seems so but idk if it scales there
There is something: https://docs.unity3d.com/Manual/xr_input.html#AccessingInputDevices
You can do a colliders on your belt and when your item collide with it and is "droped" then collider suck in in
And when player want to get it then he needs to grab it and collider suppose to release it
Ty lmao will try it later
Sorry for being a pain, i'm still struggling to make the script..
Try this
i don't have a CC
Oh, right
Thanks!
You have idea how to do this?
|| In case which you don't know: calculate diffrence between a start pos of camera and that position where is your camera now add this difference to your position ( XRRig ) amd movePosition to this position. When you are on this position yet ( check this ) then set camera again on realative 0, 0, 0 ||
|| For better experience to this for a longer range to allow player to pick from behind the wall for e.g ||
using System.Collections;
using System.Collections.Generic;
using Unity.XR.CoreUtils;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class Example : MonoBehaviour
{
public XROrigin xROrigin;
public CapsuleCollider capsuleCollider;
public Rigidbody rigidBody;
void Start()
{
xROrigin = GetComponent<XROrigin>();
capsuleCollider = GetComponent<CapsuleCollider>();
rigidBody = GetComponent<Rigidbody>();
}
void Update()
{
Vector3 center = xROrigin.CameraInOriginSpacePos;
capsuleCollider.center = center;
}
}
``` this is what i wrote, if you think it's wrong, please correct me @hasty moss
I see this like this
using System.Collections;
using System.Collections.Generic;
using Unity.XR.CoreUtils;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class Example : MonoBehaviour
{
public GameObject xROrigin;
public Rigidbody rigidBody;
public Vector3 MyNewPosition = Vector3.zero;
[Range(1, 20)]
public float speed = 2.0f;
void Start()
{
xROrigin = GameObject.Find("XRRig");
rigidBody = GetComponent<Rigidbody>();
}
void Update()
{
rigidBody.MovePosition(MyNewPosition * speed * Time.deltaTime);
if(xROrigin.transorm.position == MyNewPosition) {
transorm.position = Vector3.zero;
}
if(Vector3.Distance(new Vector(0, 0, 0), xROrigin.transorm.position) < 1) return;
MyNewPosition = xROrigin.transorm.position + transorm.position;
}
}```
BTW script was wroten fast and on knee
Thank you!
you wrote transorm so i fixed it to transform
i can't move
i think it's because it moves to 0, 0, 0 instead of the camera's position
aka xr rig
atleast that's what it seems like
Wait
The cs rigidBody.MovePosition(MyNewPosition * speed * Time.deltaTime);
Blocks your code
Do it as else to the first statment
rigidBody.MovePosition(MyNewPosition * speed * Time.deltaTime);
if(xROrigin.transorm.position == MyNewPosition) {
transorm.position = Vector3.zero;
}
else
{
rigidBody.MovePosition(MyNewPosition * speed * Time.deltaTime);
}
hey man, i think the way with the screen fade is better
you convinced me
so i want a point in place that appears when the game starts
if i move (in real life) past that point, the screen turns black and tells me where to go in order to match the point in place with the real world location, something like job simulator
@hasty moss
Camera is a child of XRRig
So the 0, 0, 0 will be always in the center
You want to calculate the distance
Between 0, 0, 0 and your HMD
1 more thing, i'm making a shooting range where you have to shoot balls in targets, can you make me a script for a gameobject with a trigger to spawn after 2 seconds and dissapear after you shoot it? if it's possible maybe even make it the second time to spawn in another place like 1-2 on the z axis @hasty moss
let me know if you need more info
In monday wil be the fastes
Today I'm tired
and tommorow I need to relax
Try to do it yourself
This sin't hard
You have plenty of videos on YT
And Free unity templae AFAIR
how should i search on the unity asset store?
You need to write in search bar ( on Unity store ) what you want
Wait, there you have a tutorial
Do it
@hasty moss aside from openvr do I need any other packages or anything or can I just put all my script and models into that now?
Just put
Write your question this will increase % of this that someone will answer you
hey i need help with jumping in vr i've done everything and when i press the button nothing happens
Show us the code
Without code I can say everything
How do i change the position from controllers with "XRI LeftHand/Position"?
also the rotation with "XRI LeftHand/Rotation"
What do you mean exactly? @foggy prism
I want to move my controllers with these values from XR Interaction Toolkit, its because it doesnt move or rotate, but it gets input
how do you get the current eye that is rendering in a script subscribed to RenderPipeline.beginCameraRendering, I've tried camera.stereoActiveEye but that always returns Mono
this is what i mean
Set the Left Controllers transform local position to the left controllers position input action
it is there
I use my own custom rig, so I don't know much about the xr interaction toolkit
Did you tried this?
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
You can set the eye on the start with this
And then you will be know on which eye is displayed
then how do I get the eye seperation from the device
what value?
if you mean from the actions then
the same with right hand, just replaced with right actions
@hasty moss