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"

Attach Icehockey Club to VR Controller/Hands

Hi, I want to attach an icehockey club to both hands in VR. I am just at the beginning, trying to attach the club to one hand. There is no need to pickup the club it just should being attached from the beginning. The club is a blueprint and the mesh has two sockets. The VR setup is the basic setup from epic. --> Motion Controller Pawn and Motion Controller BPs For now i want the club to be attached if I press M. I want to do it through level bp. I have the following setup: alt text

The problem for now is: Accessed None trying to read property LeftController if I press M Why is the LeftController null?

Product Version: UE 4.18
Tags:
levelblueprint.jpg (231.6 kB)
more ▼

asked Jan 15 '18 at 02:15 PM in Blueprint Scripting

avatar image

sandermann
26 4 8

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

3 answers: sort voted first

Oh, and also the k2 get root component which is connected to the icehockey club has none/null.

more ▼

answered Jan 15 '18 at 02:26 PM

avatar image

sandermann
26 4 8

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

If you want the hockey stick to always be attached to one hand, the easiest thing to do is to parent it directly to your motion controller component (say the right one) inside your VR Pawn's hierarchy,

Pawn Root --> MotionController Right --> Static Mesh (hockey stick)

Attaching it to the second hand is a bit tricky. In fact you cannot attach a component to two parents at the same time. You will have to "fake" it. Inside your Event Tick, continuously look at the position of the second hand (the left motion controller in this case) and adjust the relative rotation of the stick so it "follows" the second hand.

The FindLookAtRotation node could be useful in this case.

more ▼

answered Jan 15 '18 at 04:54 PM

avatar image

vr_marco
2.2k 10 6 12

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

I dont know how to do. Do you mean the component hirachy? I just have DefaultSceneRoot, VROrigin and Camera. There is no MotionControllerRight. Its generatet through blueprint.

more ▼

answered Jan 16 '18 at 10:44 AM

avatar image

sandermann
26 4 8

avatar image vr_marco Jan 16 '18 at 10:50 AM

If the hand components are created at run-time like it happens in the standard VR template, you have to use Attach To Component passing a reference to your motion controller. Check out how this is done in the standard VR template. It is inside the Blueprint for the BP_PickupCube.

(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