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"

Rotating paper2D character in c++ ?

I need a way to rotate the character in paper 2D. does SetActorRotstion work ?, if so, how can i access ?

Product Version: UE 4.19
more ▼

asked Jul 12 '18 at 09:38 PM in C++ Programming

avatar image

Fayez Nazzal
3 1 2 5

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

1 answer: sort voted first

From your character, you can GetCapsuleComponent() and use one of the rotation functions (AddLocalRotation, AddRelativeRotation, AddWorldRotation). :)

more ▼

answered Jul 12 '18 at 09:50 PM

avatar image

179 3 4 9

avatar image Fayez Nazzal Jul 13 '18 at 07:13 AM

Thank you for your comment :), now i have a little problem.

In the c++ class that attached to player, i added this :


But now it rotates everything in the world, except the player itself.
avatar image Unfathomable Jul 13 '18 at 08:37 AM

If it appears to rotate everything in the world, then your camera is attached to the component being rotated. In your camera component, under "Transform" click the drop-down for "Rotation" and change it to "Absolute Rotation", that may fix your issue.

avatar image Fayez Nazzal Jul 13 '18 at 07:53 PM

I tried to replace GetCapsuleComponent() with GetSprite(), now it works fine . 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