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"

Bone to follow pawn movement

I have a very simple skeletal mesh with just 3 bones. I would like to move those bones from my C++ code. I've read that some users in this forum suggest to use UPoseableMeshComponent. However, I'm not able to access it correctly in my code. I was wondering if it would be easier to simple link a pawn to each of those bones and then move the pawn using C++. Therefore, the bone will move when the pawn does so.

Does this make sense? I believe I could do the bone-pawn link using a blueprint and then move the pawn using C++.

Maybe I should follow a different approach? move the bones by using animation blueprinte whose inputs are send from the C++ code?

Any advice?

Product Version: UE 4.16
Tags:
more ▼

asked Jul 14 '17 at 08:37 AM in Using UE4

avatar image

javierHltn
11 2 6 8

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

This is the approach I followed: I created a Pawn class in C++ and assign to it some movement (I'll show some basic roation in this answer)

alt text

Then, I opened the BluePrint of that class in the editor and assigned to it a SkeletalMesh of a head. This SkeletalMesh is liked to an Animation BluePrint that I've also created. These are the steps I followed to link the pawn's movement generated in the C++ code to one of the bones (the neck bone) of my skeletal mesh (the head):

  1. Keep the skeletal mesh still by ignoring the roation applied to the root component. I'll do this in the pawn's event graph.

    alt text

  2. In my Animation BluePrint I:

    2.1. Get the pawn's rotation and copy it to a variable named "SkullRotation". This is done in the Event Graph

    alt text

    2.2. Apply that "Skull Rotation" to the neck bone of my skeletal mesh. This is done in the Animation Graph.

    alt text

This is the final result:

Alt Text

more ▼

answered Jul 26 '17 at 10:19 AM

avatar image

javierHltn
11 2 6 8

(comments are locked)
10|2000 characters needed characters left
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