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 setup a surface oriented mouse cursor

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

Product Version: UE 4.19
Tags:
more ▼

asked Jun 07 '18 at 05:08 AM in Blueprint Scripting

avatar image

RWMPGASBR
38 3 8

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

2 answers: sort voted first

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

https://www.youtube.com/watch?v=yo9VrxFgUJY

more ▼

answered Jun 07 '18 at 08:24 AM

avatar image

Everynone
15.2k 77 25 62

avatar image RWMPGASBR Jun 08 '18 at 05:27 AM

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.

[1]: /storage/temp/243538-screenshot-24.png

screenshot-22.png (148.0 kB)
screenshot-24.png (74.5 kB)
avatar image Everynone Jun 08 '18 at 09:11 AM

Seems to work fine on my end:

alt text

https://gyazo.com/97050b06f2f56cf600ec7f75a51b24f5

Not the result you're looking for?

capture.png (190.3 kB)
avatar image RWMPGASBR Jun 08 '18 at 10:56 AM

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

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

Hello!

I would use decals!

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

more ▼

answered Jun 07 '18 at 09:29 AM

avatar image

AZTECCO
1k 17 8 15

avatar image RWMPGASBR Jun 08 '18 at 05:36 AM

but decal will bend my cursor texture. ![alt text][1]

avatar image AZTECCO Jun 08 '18 at 06:19 AM

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

avatar image RWMPGASBR Jun 08 '18 at 08:35 AM

yep. that is what i'm trying to achieve

avatar image AZTECCO Jun 08 '18 at 10:22 AM

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!

avatar image RWMPGASBR Jun 08 '18 at 11:03 AM

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

(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