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"

Rotation negative after 180 degrees

Hi! Im trying to compare the yaw of an actors rotation and a calculated yaw, once my actor reaches the calculated yaw I would like to actor to stop rotating..

However.. my calculated yaw might be over 180 degrees (for instance it could be 270 dregrees or 360 or even more or anything in between).. The problem is that once I retrive the yaw from my actor using Get Actor Rotation-->Break Rot-->Yaw.. the yaw is always between 0-179.9999 or -179.999-0, so basically I would need a way to convert my calculated value into the same "format".. is it possible to some how simply "convert" the calculated value?

Br, Inx

Product Version: Not Selected
more ▼

asked Oct 19 '14 at 11:58 AM in Blueprint Scripting

avatar image

31 8 12 17

avatar image eXi Oct 19 '14 at 12:03 PM

How about adding ~180.0 to it.

Then -179.999 is ~0 and 179.999 is ~360.0?

avatar image Inx51 Oct 19 '14 at 12:16 PM

Im not sure if I did get you right :).. but I just tried your suggestion to substract 180 from the actors yaw, but that did not work.. what I think I need is a way to turn my calculated yaw into the same "negative format" as the actors yaw once it reaches above 180 degrees.

avatar image eXi Oct 19 '14 at 12:47 PM

ADDING 180, not subtracting.

When you have one actor from 0 - 360 and one from -179.999 - 179.999 you can either substract 180 from thefirst one or add 180 to the second one.

By subtracting, the 0 - 360 goes to -180 to 180 and the other way would be adding 180 and that would make -179.999 - 179.999 to 0 - 360.

The "~" was only a "ca.", not a minus.

avatar image Teiwaz Jan 14 '17 at 02:31 AM

That will result in his rotation being backwards. The "zero" orientation would be 180o from the normal zero.

Instead, add 360 to the rotation if the rotation is < 0.

avatar image Erasio Oct 19 '14 at 12:24 PM

It should automatically go from -179.999 to 179.999 or the other way around if you add more to the rotator...

e.g. : You're at 0. If you now add 270 you're at -90. That's at least how it should work.

avatar image Imagine-Games Jan 13 '17 at 01:25 PM

im having a similar issue, i have a drone that tilts sideways on its Y axis depending on the Z rotation amount, however once it goes from 180 to a - value or the other way around from 50 to -50 as soon as the value becomes negative the Y axis jumps to the opposite side (instead of going smoothly as it does from 0 to 180, or even from -1 to -180)...

adding +180 to keep it as a positive value always did nothing if not make this even more buggy for me...

did you figure this out?

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

3 answers: sort voted first

If your calculation is over 180 degrees, subtract 360 degrees from it, otherwise not.

more ▼

answered Oct 19 '14 at 12:24 PM

avatar image

885 46 45 80

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

answered Oct 19 '14 at 07:01 PM

avatar image

576 52 56 77

avatar image eXi Oct 19 '14 at 07:28 PM

Maybe he doesn't use Paper2D :D

avatar image Roccinio Oct 19 '14 at 09:07 PM

If i am not mistaken this is a general problem.Dont know.It really looks identical to the problem i had.

avatar image eXi Oct 19 '14 at 09:24 PM

Wasnt your Problem something with -130 to 130? So you were missing 100°? :/ it seems normal that the range goes from -180 to +180. At least thats a circle :D i guess there are moments when a negativ value is usefull.

I still think he just needs to add 180 to this number so it 0 to 360.

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

alt text Begin Play: - Save the rotation of the first actor. - Call this function and save the angle. On Tick: - Call this function again and get the delta against first saved angle. - Add this delta to the rotation Z (in my case) and then set the actors rotation to this final rotation.

howtorotate.png (138.5 kB)
more ▼

answered Jun 20 '18 at 01:22 PM

avatar image


(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