# How to setup a surface oriented mouse cursor

**URL:** <https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850>\
**Category:** Blueprint\
**Tags:** surface, orientation, mouse-cursor, unreal-engine, Blueprint, question\
**Created:** [June 7, 2018, 5:08am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850 "2018-06-07T05:08:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![smooth.criminal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@smooth.criminal](https://forums.unrealengine.com/u/smooth.criminal)\
**Post date:** [June 7, 2018, 5:08am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/1 "2018-06-07T05:08:59Z")

</div>

how to create a mouse cursor that follows surface orientation in game (something like vertex paint tool in editor)

 ![243401-screenshot-16.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/b/ceb3da160575d761bc506e39343a557cadf14b78.png)

?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [June 7, 2018, 8:24am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/2 "2018-06-07T08:24:04Z")

</div>

It’s rather simple. Look into linetrace and use the hit normal and position.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/0/5/c059ef303f6b11602896796cc55b215c0ce0f257.jpeg "WTF Is? Line Trace By Channel Node in Unreal Engine 4 ( UE4 )") ](https://www.youtube.com/watch?v=yo9VrxFgUJY)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a9f83bc6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a9f83bc6](https://forums.unrealengine.com/u/anonymous_user_a9f83bc6)\
**Post date:** [June 7, 2018, 9:29am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/3 "2018-06-07T09:29:57Z")

</div>

Hello!

I would use decals!

Do a line trace and apply a decal… Move it every time you move the camera or the cursor

---

<div class="post-metadata">

**Author:** ![smooth.criminal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@smooth.criminal](https://forums.unrealengine.com/u/smooth.criminal)\
**Post date:** [June 8, 2018, 5:27am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/4 "2018-06-08T05:27:27Z")

</div>

thanks. but the thing is i’m using a custom mouse input ( for first person shooter ) in this case mouse point ( the crosshair ) doesn’t stay in the center of the screen or follow the camera.  
i tried get hit result under cursor didnt get what i wanted.

---

<div class="post-metadata">

**Author:** ![smooth.criminal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@smooth.criminal](https://forums.unrealengine.com/u/smooth.criminal)\
**Post date:** [June 8, 2018, 5:36am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/5 "2018-06-08T05:36:23Z")

</div>

but decal will bend my cursor texture.

 ![243540-screenshot-26-li.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/2/f/62fb15cf4dfd8f02dee5d7afefe934761ddba085.jpeg)

][1]

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a9f83bc6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a9f83bc6](https://forums.unrealengine.com/u/anonymous_user_a9f83bc6)\
**Post date:** [June 8, 2018, 6:19am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/6 "2018-06-08T06:19:10Z")

</div>

So you want your cursor to appear the same even if a part of it goes outside the surface? Like in the picture?

---

<div class="post-metadata">

**Author:** ![smooth.criminal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@smooth.criminal](https://forums.unrealengine.com/u/smooth.criminal)\
**Post date:** [June 8, 2018, 8:35am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/7 "2018-06-08T08:35:54Z")

</div>

yep. that is what i’m trying to achieve

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [June 8, 2018, 9:11am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/8 "2018-06-08T09:11:36Z")

</div>

Seems to work fine on my end:

 ![243558-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/c/89c040db941ef30cc12d19769d880f277b2e205d.png)

[![https://gyazo.com/97050b06f2f56cf600ec7f75a51b24f5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/d/d/cdd9cdbcd510979f3795dfcd8df223a94a3c806c.gif)](https://gyazo.com/97050b06f2f56cf600ec7f75a51b24f5)

Not the result you’re looking for?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a9f83bc6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a9f83bc6](https://forums.unrealengine.com/u/anonymous_user_a9f83bc6)\
**Post date:** [June 8, 2018, 10:22am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/9 "2018-06-08T10:22:37Z")

</div>

If so instead of decal you may spawn a plane mesh whit a masked/traslucent material, it will automatically scale down as you poin far from your perspective, you’ll need some vector calculations but it won’t be too hard to achieve, and you can also easily make material instances for different cursor types!

---

<div class="post-metadata">

**Author:** ![smooth.criminal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@smooth.criminal](https://forums.unrealengine.com/u/smooth.criminal)\
**Post date:** [June 8, 2018, 10:56am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/10 "2018-06-08T10:56:29Z")

</div>

ah yes. it worked. thanks a lot :] .

---

<div class="post-metadata">

**Author:** ![smooth.criminal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@smooth.criminal](https://forums.unrealengine.com/u/smooth.criminal)\
**Post date:** [June 8, 2018, 11:03am UTC](https://forums.unrealengine.com/t/how-to-setup-a-surface-oriented-mouse-cursor/426850/11 "2018-06-08T11:03:08Z")

</div>

thanks a lot . Everynones( person above :] ) method worked.
