Posts: 10
Threads: 5
Joined: May 2020
Reputation:
0
I want to let bike turns 90 degrees to the left or right. So, I found the parameter named "MaxTurn" in the VZPlayer script. But it cannot change the bike's max turning degree when I adjust the MaxTurn value. Is there any parameter can work for it or any function can be called for it?
Posts: 1,059
Threads: 66
Joined: Jul 2018
Reputation:
52
07-28-2020, 09:37 PM
(This post was last modified: 07-28-2020, 09:37 PM by emalafeew.)
Ok, we're talking about the VZfit SDK here.
The MaxTurn parameter is the right place to start, but you may also need to adjust LeanIn and LeanFudge.
MaxTurn dictates the limit, in radians, of the avatar movement direction relative to your rest direction. The default is 0.5, for 90 deg set it to 1.57.
LeanIn determines how much the avatar turns to actually follow it's movement. The default is 0.5, set it to 1.0.
LeanFudge determines how much your head offset or tilt (depending on VR platform) affects avatar movement direction. The default is 2, but if you're tripling MaxTurn you may want to triple this to 6.
Note you may find this pretty uncomfortable which is why we have lower values for our games!
Posts: 10
Threads: 5
Joined: May 2020
Reputation:
0
Thank you very much. Those values are working successfully, but there is another problem happened while turning 90 degrees to left or right. The bike will automatically go back to the default direction when the avatar stops. I want to keep the movement direction after releasing the A, D key, so what should I do to resolve it.
Thanks for reading it.
Posts: 1,059
Threads: 66
Joined: Jul 2018
Reputation:
52
To fix that set VZPlayer.RotateAtStop true, and set VZPlayer.SlowRotateLimit to 1
Posts: 10
Threads: 5
Joined: May 2020
Reputation:
0
Is there any way to synchronize orientation of HTC Vive Headset to the bike's?
The solution that set VZPlayer.RotateAtStop true, and set VZPlayer.SlowRotateLimit to 1 is not working. So, we want to change another way to fix it.
Posts: 1,059
Threads: 66
Joined: Jul 2018
Reputation:
52
08-19-2020, 12:32 PM
(This post was last modified: 08-19-2020, 12:33 PM by emalafeew.)
That solution only works if you also lean. If you want the bike rotation to just follow your head, then you can set it to the same rotation after VZPlayer.Update.
As an example you could subclass vzplayer and do like
override void Update () {
base.Update();
var angles = Controller.Head.eulerAngles
angles.x = angles.z = 0;
transform.eulerAngles = angles;
}
Posts: 2
Threads: 1
Joined: Feb 2020
Reputation:
0
Thanks for giving this solution. It can perfectly resolve the rotation problem. However, we hope that the bike can move along the changed orientation after adjusting the variable "mRigidbody.velocity" , but it didn't work well. So, I want to know whose direction the Bike depends on when moving, or how could I make bike move along the forwarding direction of itself.
Posts: 1,059
Threads: 66
Joined: Jul 2018
Reputation:
52
08-20-2020, 02:26 PM
(This post was last modified: 08-20-2020, 02:30 PM by emalafeew.)
I think you are talking about overriding VZPlayer so much that it may not make sense to use.
VZPlayer was designed to use VZController data to move and turn in ways that reduce simulation sickness, as described in [url="https://www.virzoom.com/2019/01/03/vr-that-moves-you/"]this blog post.[/url]
But you don't have to use it, you can just put the VZController.prefab into your scene instead, and call ConnectBike() and other things on it like VZPlayer.cs does and apply your own character and camera motion.
Or you can modify VZPlayer.Update() directly to specify the camera and camera motion you want, instead of what our plugin returns.