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"

How to get angle from 0 to 360 from Rotator?

Hi guys I have a question. I am rotating an object and I try to get the angle of the rotation. So its starts with 0 and when I want to make 360 the rotator goes to 90 then goes to 0 and from 0 it goes to -90 and from -90 it goes to 0 again. Can I make it return an angle from 0 to 360 instead of being limited to 90 or -90?

Product Version: UE 4.20
Tags:
more ▼

asked Feb 15 '19 at 06:14 PM in Blueprint Scripting

avatar image

Sh0ck1ngPh3n0m
1 2 1 3

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

2 answers: sort voted first

I've actually solved it the easiest way I could possibly think of. I just created auxillary float variable which I incremented and decremented by the same value that I was adding to the object's rotator to rotate it. Then I clamped this value to fit between 0 and 360 degrees.

more ▼

answered Feb 15 '19 at 07:06 PM

avatar image

Sh0ck1ngPh3n0m
1 2 1 3

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

You can just add 360 to the rotation value whenever it's less than 0.

Best, Jonathan Lambert

more ▼

answered Feb 15 '19 at 06:48 PM

avatar image

Jon.Lambert
21 1 1

avatar image Sh0ck1ngPh3n0m Feb 15 '19 at 07:05 PM

Thanks for your reply Jonathan. But the values in for instance 3rd and 4th quarter of the circle are the same. I've actually just solved the issue and was going to post an answer. Thank you for your time.

(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