x

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"

Get Value from VR Blueprint

Hey so I want to get the position and rotation of a component from one of the included VR blueprints, the MotionControllerPawn to be exact. I need to use these values in a C++ script so my question is how do I send these values to a C++ script? Is there something I can add to the blueprint that fetches a value every frame? Or can I somehow access the position and rotation of the Actor's camera component in a C++ script? I'm very new to this so I'm not sure if it is very obvious. alt text alt text As you can see above I want the Variables; HMD X Pos, Y Pos, Z Pos, X Rot, Y Rot, and Z Rot to be referenced in a c++ script

So What I want to do is access these float variables in a C++ script, then using said C++ script display those values on the screen or print them in the console.

Thanks for your help and please keep in mind I'm very new to all of this. If you need to see this blueprint to help me get ideas it is included in the VR Blueprint included project and called "MotionControllerPawn"

Product Version: UE 4.21
Tags:
q1.png (50.4 kB)
q2.png (62.9 kB)
q3.png (152.0 kB)
more ▼

asked Jan 22 '19 at 07:20 PM in VR

avatar image

MrJackio
1 1 2

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

1 answer: sort voted first

There really no need to involve blueprints here, create C++ class for your pawn, declare camera component in it (with UPROPERTY(EditAnywhere, BleuprintReadWrite) so you can manipulate component in blueprint) and then just get location right in C++. Then just make VRPawn blueprint do edits oyu want from you C++ pawn and that it, you can also reparent exiting blueprint too.

more ▼

answered Jan 24 '19 at 12:32 AM

avatar image

Shadowriver
36.7k 932 169 1111

(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