iMMERGENCE Posted August 18, 2018 Share Posted August 18, 2018 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 More sharing options...
Tony PH Lin Posted August 23, 2018 Share Posted August 23, 2018 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 More sharing options...
iMMERGENCE Posted August 23, 2018 Author Share Posted August 23, 2018 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 More sharing options...
iMMERGENCE Posted August 27, 2018 Author Share Posted August 27, 2018 finally, not better with "&&" in code. have just diagonal movement. i found another way. it's better i think Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.