I want to know the method of changing the bike's max turn value. - Printable Version

+- (https://forums.vzfit.com)
+-- Forum: VZfit Forum (https://forums.vzfit.com/forumdisplay.php?fid=5)
+--- Forum: General Discussion (https://forums.vzfit.com/forumdisplay.php?fid=6)
+--- Thread: I want to know the method of changing the bike's max turn value. (/showthread.php?tid=392)



I want to know the method of changing the bike's max turn value. - wmlabsteam - 07-28-2020

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?


RE: I want to know the method of changing the bike's max turn value. - emalafeew - 07-28-2020

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!


RE: I want to know the method of changing the bike's max turn value. - wmlabsteam - 07-29-2020

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.


RE: I want to know the method of changing the bike's max turn value. - emalafeew - 08-03-2020

To fix that set VZPlayer.RotateAtStop true, and set VZPlayer.SlowRotateLimit to 1


RE: I want to know the method of changing the bike's max turn value. - wmlabsteam - 08-19-2020

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.


RE: I want to know the method of changing the bike's max turn value. - emalafeew - 08-19-2020

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;
}


RE: I want to know the method of changing the bike's max turn value. - wmlab - 08-20-2020

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.


RE: I want to know the method of changing the bike's max turn value. - emalafeew - 08-20-2020

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.