Feedback on Controller

iMMERGENCE
Builder

Feedback on Controller

Since in begin to develop on Vive Focus, i am several problem with the controller. i explain, i used for moving my player in the scene the touch pad input of the controller and sometimes it blocked to left side and my player going to the left and i have no touch but it continue to go to the left. I quit my app and relaunch, he continue to going to the left and i have no notouch yet the controller. so i decide to remove the battery from the controller and reput them inside, and everything is back to normal. my player don't go to the left, controller is reset. So this is the code i used for moving my player. Do you think it is the controller or my code make this error ?

 

THX

 

 

	 void Update()
	{
if (WaveVR_Controller.Input (device).GetTouch (WVR_InputId.WVR_InputId_Alias1_Touchpad)) {

						var axis = WaveVR_Controller.Input (device).GetAxis (WVR_InputId.WVR_InputId_Alias1_Touchpad);

						if (axis.y > 0.2f || axis.y < -0.2f) {
							animShoes.SetBool ("walkForward", true);
						}

						Vector3 dir = cam.TransformDirection (new Vector3 (axis.x, 0, axis.y).normalized);
						dir.y = 0;

						if (axis.y > 0.2f || axis.y < -0.2f || axis.x > 0.2f || axis.x < -0.2f) {
						userRigid.MovePosition (userRigid.position + dir * Time.deltaTime * 1.75f);
						}
					}
}

 

Vive Staff

Re: Feedback on Controller

Hi,

 

I think you might want to use “&&”, not “||”. (my guessing)

For example: Not sure if it's improved.

 

void Update() { if (WaveVR_Controller.Input (device).GetTouch (WVR_InputId.WVR_InputId_Alias1_Touchpad)) { var axis = WaveVR_Controller.Input (device).GetAxis (WVR_InputId.WVR_InputId_Alias1_Touchpad); if (axis.y > 0.2f && axis.y < -0.2f) { animShoes.SetBool ("walkForward", true); } Vector3 dir = cam.TransformDirection (new Vector3 (axis.x, 0, axis.y).normalized); dir.y = 0; if ((axis.y > 0.2f && axis.y < -0.2f) && (axis.x > 0.2f && axis.x < -0.2f)) { userRigid.MovePosition (userRigid.position + dir * Time.deltaTime * 1.75f); } } }

iMMERGENCE
Builder

Re: Feedback on Controller

Thanks Tony, i will try if better with "&&"

i do this for have less sensitivity when i touch the pad.

i am in reflextion if its better to use GetPress Pad for moving my player.

do you have time to test my prototype ? i work alone i really need extra look from another personn who ahve some experiences.

 

 

Highlighted
iMMERGENCE
Builder

Re: Feedback on Controller

finally, not better with "&&" in code. have just diagonal movement. i found another way. it's better i think