### Search in Sort by:

 Everything Blueprint Scripting Current Space

### 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 can I get the camera vector in worldspace in a material?

 0 I wanted to create a material that would give me the angle in radians in X and Y between the camera and the object the material is applied to. (I wanted this as a basis for a effect that would change depending on whether I looked to the left, right, top, or bottom of the object). I'm not a programmer so I wrote down the calculations I thought I'd need in order to get this to work. Basically I figured I would need the WSposition of the object and the WSposition of the camera in order to get the WSvector from the camera to the object. And I would need the WSvector of the camera. Then I could just just normalize those vectors and use a asin to get radians for both of them in WS, and subtract one from the other in order to get the angle in rad between the cameraforward and the direction of the object. Problem is, apparently for some reason Camera vector gives your the vector of the camera compared to the normal of each pixel? And I have no idea what "cameradirectionvector" does but not what I thought it would. Is there a way to get the rotation of the camera in a material blueprint or is there something I'm missing? I'm guessing I might be able to do it by making it a dynamic material and driving a few parameters through blueprints but since you directly have the "cameravector" node in the material blueprint editor I figured it should logically be possible there as well, or is there a reason that's not possible? Any help would be greatly appreciated Product Version: UE 4.19 Tags: more ▼ asked Oct 30 '18 at 01:11 PM in Blueprint Scripting S.g.m.Klessens 6 ● 2 ● 2 add new comment (comments are locked) 10|2000 characters needed characters left ▼ Viewable by all users