Jump to content

Feedback on Controller


iMMERGENCE

Recommended Posts

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...