# Problem with rotate vector

**URL:** <https://forums.unrealengine.com/t/problem-with-rotate-vector/1866876>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [May 21, 2024, 9:55pm UTC](https://forums.unrealengine.com/t/problem-with-rotate-vector/1866876 "2024-05-21T21:55:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nait123321](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nait123321](https://forums.unrealengine.com/u/nait123321)\
**Post date:** [May 21, 2024, 9:55pm UTC](https://forums.unrealengine.com/t/problem-with-rotate-vector/1866876/1 "2024-05-21T21:55:22Z")

</div>

Hello!  
I ran into a problem regarding turns. I have an actor that has a static cone mesh (rotated 90 degrees by Pitch ). I need to draw a line down from the center of the cone’s radius (the line should always go down parallel to the cone). I did the basic implementation(startpos+direction\*length) and in the normal position everything works(even if I rotate by **Pitch** and **Yaw** ), but if I rotate the actor along the **Roll** axis, the line rotates along with the actor.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/6/e8640f0a07ab7ab582b45bbf6b75eebc0a29011b.png)

What I tried:

1. Rotate the result dir vector
2. Set 0 roll to the component rotator before make vector
3. Combine rotators (minimize the difference in the roll)

But in all this cases line have strange behavior(change direction or target to random point). Google/ChatGPT didn’t help, has anyone encountered something similar?

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [May 21, 2024, 10:22pm UTC](https://forums.unrealengine.com/t/problem-with-rotate-vector/1866876/2 "2024-05-21T22:22:46Z")

</div>

Are you using the components up vector to get the end point of the vertical line? If not then share the bp to get an idea of what is happening.

---

<div class="post-metadata">

**Author:** ![nait123321](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nait123321](https://forums.unrealengine.com/u/nait123321)\
**Post date:** [May 21, 2024, 10:34pm UTC](https://forums.unrealengine.com/t/problem-with-rotate-vector/1866876/3 "2024-05-21T22:34:05Z")

</div>

Problem was in rotated component(SM\_Cone). I rotated static mesh(by model edit tool plugin) as default and for now everything is working. So issue was in complex transform offset.  
I will be glad if my solution helps someone save time and nerves in the future 🙂

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 20, 2024, 10:34pm UTC](https://forums.unrealengine.com/t/problem-with-rotate-vector/1866876/4 "2024-06-20T22:34:52Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
