Using VR hands to make a counter go up adds two values to a single Integer
Hi, I'm making a game that requires the player to use both the hands in VR to hit away balls being shot at them and this makes an integer count how many times the player hits the balls, but the single variable I made increments for each hand and not singularly for both hands.
This us the output when I only use one hand. Counter works fine.
And this is the output when both hands are being used. As you see the single variable now shows two values, one for each hand
This is the collision and increment I implemented.
I am not sure if I am doing it wrong or if it is a bug. Using Oculus.
As you are using two controllers, you have two BP_MotionController objects in your scene that independently keep track of the number of ball they hit.
What you need is to create a counter inside another class. For instance, inside your Player Controller class or inside your Pawn class. Once you've done that, you can keep the same logics but instead of incrementing the counter "Hit counter" located inside you "BP_MotionController", you increment the one you created inside your Player Controller class (or Pawn class that's up to you).
Hope it helps!
answered Mar 16 '19 at 10:23 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here