Jump to content
Happy Holidays! Limited Staff Responses: 1/20 - 1/31 ×

Feedback on Controller


iMMERGENCE
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...