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"

Make parent rotation match child rotation

I have a character that has CapsuleComponent as root and couples of SkeletalMesh as my character mesh. Now there is case that I'm using mouse input to rotate`SkeletalMesh` on Pitch and Yaw while this happens ActorRotation made to remain still, and after that process the SkeletalMesh has a wrong forward facing. also the skeletalMesh has -270 to 270 rotation while ActorRotation has -180 to 180, so when SkeletalMesh reached 180 it goes to 181 and so on while ActorRotation on 180 reached it goes to -180 to -179 and so on. idk if this matters or not i just pointing it out.

  • As the title says how can i match the Parent Actor Rotation to it's child rotation while the child rotations remains the same?

I'm using MoveComponentTo() to move the whole actor, and in process the rotation is locked and i can't rotate the whole actor, here i switch to SkeletalMesh rotation till the moving part is done, and that's where i end up with wrong forward facing for the SkeletalMesh.

That would be a great help if some one could help me out, already spend a whole day on it.

Product Version: UE 4.20
Tags:
more ▼

asked Dec 09 '18 at 04:29 PM in C++ Programming

avatar image

ATHIEK
1 1 3

avatar image Joakim Olsson Dec 09 '18 at 05:42 PM

Is there a reason why you cant rotate the actor instead of the skeletal mesh?

avatar image ATHIEK Dec 09 '18 at 06:01 PM

Yes, I'm using MoveComponentTo()

UKismetSystemLibrary::MoveComponentTo(GetCapsuleComponent(), CharacterLoc, CharacterRot, false, false, .2f, false, EMoveComponentAction::Type::Move, LatInfo);

and once I give the CharacterRotation, it just locks the actor rotation until the movement is done. so with that i just switch the mouse input to add rotation to CharacterMesh instead of whole actor.

avatar image ATHIEK Jan 23 '19 at 05:18 PM

Bump, my game almost finished and this parts holds it back from releasing it, i did found FindLookAtRotation but idk how i should use it here. maybe there is similar function that does this?

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

0 answers: sort voted first
Be the first one to answer this question
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