Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

alt text

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

alt text

This is the collision and increment I implemented.

alt text

I am not sure if I am doing it wrong or if it is a bug. Using Oculus.

Product Version: UE 4.21
bothhandscount.png (12.8 kB)
callcount.png (108.7 kB)
more ▼

asked Mar 16 '19 at 09:59 PM in VR

avatar image

3 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi Hennie_AxioVR,

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!


more ▼

answered Mar 16 '19 at 10:23 PM

avatar image

179 3 9 7

avatar image Hennie_AxioVR Mar 17 '19 at 09:10 AM

Hi, will jump into doing that right now, thank you.

avatar image Hennie_AxioVR Mar 17 '19 at 10:20 AM

So I solved it not by casting to my pawn but instead created the variable inside my GameMode blueprint and casting to it, thank you.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question