Switching hands at runtime

iMMERGENCE
Builder

Switching hands at runtime

For my bowling game, do you have sample code for switching hand right to left and left to right at runtime please ?

cause i have multiplayer offline and each player play turn to turn, maybe some are left handed, other right handed, i d like to add an option for save in memory each player which hand have.

 

video4_Moment9.jpg

Moderator

Re: Switching hands at runtime

Did you take a look at the Controller Manager scene in Samples? (actually take a look at the commented out codeand see if that's working)

 

iMMERGENCE
Builder

Re: Switching hands at runtime

oh super, i found exactly, it seems to be the script i need. i wil try now !

Highlighted
iMMERGENCE
Builder

Re: Switching hands at runtime

the sample code not work for me.

i used it like in screenshot, when i play on Focus with Left hand Mode, its is Right hand appears always.

i have the same problem since 2 month with all sdk sample. what is my error ?

 

unity.JPG

iMMERGENCE
Builder

Re: Switching hands at runtime

this is the code i do, for have left hand , and right hand at statup the game in focus.

 

	private void CheckHandActive(){
		if (WaveVR_Controller.Input(WVR_DeviceType.WVR_DeviceType_Controller_Right).connected)
		{
			if(WaveVR_Controller.IsLeftHanded){

				rightHandController.SetActive (false);
				leftHandController.SetActive (true);
				userIsLeft = true;
			}else{
				rightHandController.SetActive (true);
				leftHandController.SetActive (false);
				userIsLeft = false;
			}
		}
	}

 

with this code, it is ok. it is more simple like other code WaveVR_ControllerManager.

the particularity is, i need to use a right and type mode on lefthand gameObject. if i put left type, it doen't work !? that is very strange.

unity2.JPG

 

So after, i want to switching at runrime with a menu (What is your hand ? Right or Left ?)

 

i try this code but It blocked, i lost controller, it disapear.

 

public void ChangeHandToLeft(){
	        WaveVR_Controller.SetLeftHandedMode (true);
		rightHandController.SetActive (false);
		leftHandController.SetActive (true);
		userIsLeft = true;
	}

	public void ChangeHandToRight(){
	        WaveVR_Controller.SetLeftHandedMode (false);
		rightHandController.SetActive (true);
		leftHandController.SetActive (false);
		userIsLeft = false;
	}

can you ask to a developper please ? for know why left type display the right hand ? and how switch.

 

Gige us the right code please ... you use in the menu of vive focus in settings.

 

Best

 

 

Vive Staff

Re: Switching hands at runtime

Hi @iMMERGENCE,

 

After checking, your code doesn't work because it's blocked due to design philosophy.

In current design we assume all hand switch is selected from setting on our Launcher.

I can imagine in your multiplayer game, you'd like each player can select right/left hand on their turn.

I'll raise this request internally how we can provide.

Thanks.

 

iMMERGENCE
Builder

Re: Switching hands at runtime

Oh heard, yes it was to improve the gameplay in case there will be more players with the same HMD and if one of them is left-handed.

 

Ok I understand that it is before the launch of the application that it is necessary to parameter this choice. So hoping that there is not too much left-handed in the world who wants to play bowling on the Focus.

I will try to make a multi player online one to one, it could be nice.

Ok thank you for putting the info back to your teams.

I was wondering if it is possible to have two controllers with the Vive focus?

is it possible to order a single controller? because mine has fallen several times and it sometimes seems buggy and no longer hold the trigger Get pressed continuously. I sometimes have trouble grasping my object for example.

Tell you soon
best,