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"

Converting 0-360 rotation to 0-1 rotation

Hey guys, Recently I've encountered a problem with a dynamic instance material. I have a material set to work on world position, but I also have a custom rotator to rotate the texture when I rotate the actor using it (in the construction script I simply created a dynamic instance material and changed the rotation parameter of the material with a "get actor rotation" node. With some workarounds I can make it more or less functional - but it's terribly buggy.

The main problem is that the actor rotates from 0 to 360, while the CustomRotator node requires a 0-1 value. Is there any node capable of translating a 0-360 actor rotation to a 0-1 rotation value?

Product Version: UE 4.22
more ▼

asked Apr 11 '19 at 04:08 PM in Blueprint Scripting

avatar image

13 3 3

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

2 answers: sort voted first

Just divide the value by 360. That will give you a balue between 0 and 1. Another thing tou can look into is nodes that say normalize, for example theres a normalize to range which takes in a float and outputs a 0-1.

more ▼

answered Apr 11 '19 at 08:27 PM

avatar image

10.1k 33 10 25

avatar image drichardson Apr 11 '19 at 11:52 PM

Also @LucasFoxArt if you ever have to map values that don't both start at 0, you can use Map Ranged Clamped/Unclamped.

avatar image LucaFoxArt Apr 12 '19 at 09:51 AM

Hey there! Thanks a lot for the help :) Dividing for 360 was my first try but it didn't work - problem is, it turned out it wasn't working because of an error I made.

So dividing for 360 was the correct solution!

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

you could also use a dot product alt text

dotproduct.png (169.1 kB)
more ▼

answered Apr 11 '19 at 11:35 PM

avatar image

1.4k 10 4 10

(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