Why is MapBox lagging in Unity VR? - c#

I am trying out the MapBox SDK for Unity.
https://www.mapbox.com/unity/
This provides a 2D map where you can zoom in and out to preview
different levels of detail.This honestly works like a charm.
I am trying to get this 2D map working in Virtual Reality.
The only problem is that it is lagging since the VR camera moves a
lot.
I am using either SteamVR Player or CameraRig.
Does someone know how to improve the MapBox performance for Virtual Reality?
At this point, my unity is just freezing.
I am looking forward for any advice / insight

Related

Gesture recognition with Unity, Oculus Quest and the Oculus Quest Integration package

I'm trying to implement hand gesture recognition for Oculus Quest with Unity and the Unity Oculus integration package.
I've read the "Hand Tracking in Unity" documentation on the Oculus developer website, but they only talk about getting the current pinch of the fingers, which is not what I want:
https://developer.oculus.com/documentation/unity/unity-handtracking/
I thought about getting fingers flexion for each finger (with a value between 0 and 1 for example), and then training a k-NN model with the 5 features to then be able to recognize the nearest gesture. But I've been searching for hours and didn't find anything about getting finger position, the only thing I found is getting the pinch.
By looking in the OVRSkeleton.cs file (from the Oculus Integration package), I've been able to get the current Transform for each bone (so the position as a vector and the rotation as a quaternion), but I don't really know how to calculate or get an estimate for the finger flexion with that (or anything useful to perform gesture recognition)
OVRSkeleton skeleton = GetComponent<OVRSkeleton>();
skeleton.Bones[(int) OVRPlugin.BoneId.Hand_Index1].Transform.position
skeleton.Bones[(int) OVRPlugin.BoneId.Hand_Index1].Transform.rotation
The list of bones IDs is in the "Hand Tracking in Unity" documentation page.
In fact, what I want to implement seems to look exactly like this package:
https://assetstore.unity.com/packages/tools/integration/vr-hand-gesture-recognizer-oculus-quest-hand-tracking-168685
Any help, ideas or comments about how to calculate fingers flexion, or any other solution to implement gesture recognition would be greatly appreciated!
Thanks
A few things/links I've explored so far:
https://www.reddit.com/r/OculusQuest/comments/elrn7a/unity_hand_tracking_and_different_gestures/
https://forums.oculusvr.com/developer/discussion/89615/detect-custom-hand-gestures
https://github.com/jorgejgnz/HandTrackingGestureRecorder is something im trying currently, the docs dont say it has a depenedency, but apparently it does, and i dont have it working yet.
you can access the bone rotations at runtime and compare those to a recorded gesture. i think its closer to "template matching" than machine learning, measuring the error between two poses.

Problem with Pixel Perfect Camera and Cinemachine in Unity 2D

I have a problem when I add a 2D pixel-perfect camera component onto the camera and a Cinemachine 2D virtual camera in the scene, the camera jitters around.
This is my configuration for the virtual camera
This is my configuration for the pixel-perfect camera component
I used the experimental 2D renderer in the universal render pipeline.
I had the same problem. Recently figured out what was cousing it. So it's universal render pipeline with it's pixel perfect camera (experimental) component. I turned off urp and switched to pixel perfect camera (not experimental) and everything is smooth now, but sadly no more urp. So let's just hope they will fix it in the future and there will be oportunity to use urp with pixel perfect without jittering.
P.S. if you'll find another solution please let me know)
I just found this: Cinemachine Pixel Perfect extension.
Which doesn't fix it for me because I'm using a Target, but in case anyone has this problem and wants to try it.
The documentation even says:
The following are the current limitations of the extension:
When a virtual camera with the Pixel Perfect extension is set to follow a Target Group, there may be visible choppiness when the virtual camera is positioned with the Framing Transposer component.

TILED 2D Tilemap is jumpy/jerky in Unity

Using the application Tiled I made a 2D tilemap for a 2D Unity game I am making. The game is very simple, and the map consisted of only some regular tiles, and some with collision detectors. When I import the map into Unity to use for my game with Tiled2Unity, the game loads fine and everything works well, except every now and then the map skips like there is a rendering lag. The jump seems to be independent of the size of the tilemap, does anyone have any idea what the problem could be? I'm happy to answer any questions about the situation.
Here is a picture, you cannot see the problem because it's not a video but here is the situation at least:

Using unity as a render engine for 2D games

Is it possible to use Unity as a render engine? I have a game which is written in C# and I would very much want to rewrite it to use Unity because of it's portability and use of C#. The game itself is a 2D maze game (think Pac-man).
I read alot of tutorials for using Unity for 2D games but all of them used almost only menus and editors which embedded in Unity and used only small portion with C# or other programming language. If I'm going to go down this road it means I need to "rewrite" my whole game logic with Unity's editors/menus/managers etc...
I'm looking to use it like the XNA library for example. Is there any way to achieve that with Unity? If not, is there another game engine/library using C# which is cross-platform and canm be run under mobile devices?
I made Fangz (https://www.youtube.com/watch?v=x6-5D6IkD5E) using Unity. If that doesn't prove that a complex 2d game can be made in Unity, I don't know what does :).
You can use Unity like XNA, but that would deny you from Unity's strengths. Once you get used to visualising your member variables in an editor in a custom way (via inspector editor scripts) it'll be hard to go back :).
Furthermore Unity now has native 2d support, which is as good is not better as 2d Toolkit, once of the most well designed 2d packages I've had the pleasure of working with.
Another advantage of Using Unity is that you'll be able to easily add animations to your 2d game. Just add an animation component, press record and move.
All in all I find myself thinking the other way around: how can anyone do a 2d game in anything other that Unity :).

How To Apply Bounds in Unity For iOS devices

I've made an unity game for iOS devices. It has a game object(sphere) which moves by the force applied to it. But I want to limit the sphere within the screen bounds.
I've seen the unity reference to Bounds, but i don't know how apply it according to the iOS device screens. Please Help.
ThankYou.
Use Mathf.clamp to keep your movement within the screen size. This will be more efficient than using colliders on the edges of your screen. Just play around with your object until you get the right numbers to keep it on your screen. Of course if you plan to use iOS tablets etc you will need to be able to account for the change in your clamping area.
Here is a link to the Unity Documentation which actually includes an example of what you are trying to do.
http://docs.unity3d.com/Documentation/ScriptReference/Mathf.Clamp.html

Categories