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 tell object that I am not aiming at it anymore

Hello, by LineTracing from my camera I can tell object to do some event. For example, when I look at BP_UseableItem I make CastToBP_UsableItem and call event for making an outlane (or whatever)

And when Im not looking at this object anymore how can I tell him to stop being outlined (for example) since I cant Cast to it anymore?

Whats the efficient way?

Product Version: UE 4.12
Tags:
more ▼

asked Jul 24 '16 at 01:53 AM in Using UE4

avatar image

Xukapy
138 13 20 30

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

3 answers: sort voted first

The easiest way would most likely be to simply do a linetrace every tick and every time it hits something set that something to have an outline that fades over a small amount of time. This will reset it as long as you are aiming at it, but it will go away shortly after you aim away.

You can also have a check inside the actor doing the linetrace to see if we are still hitting the same object. Once we are not you can call a function in the other actor to toggle its outline. This way you will toggle it when you start hitting it and you will toggle it when you stop hitting it.

more ▼

answered Jul 24 '16 at 03:19 AM

avatar image

NoobsDeSroobs
2.7k 107 35 180

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

you can do this using vector math instead of linetrace too. you have an exemple of this in the substance plugin demo scene (on the market). this work using a vector math, and it returns 1 when you r looking to the objects pivot point. so you can add a "tolerance" for it. here an exemple : the upper part is for distance, the bottom one for the "look at" alt text

lookat.jpg (110.0 kB)
more ▼

answered Jul 24 '16 at 09:57 AM

avatar image

expose
769 26 5 43

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

@NoobsDeSroobs Thanks, Ive come with idea of making check for hitting same or new actor every tick on myself but thought there should be more efficient way with something like OnStopBeingLookedAt event :D

@expose Ye, I saw it but making this kinda math on every usable object in world every tick looks kinda heavy.

Thanks guys, I guess I'll have to store hitting Actor and check for it every tick until I find better solution.

more ▼

answered Jul 24 '16 at 12:58 PM

avatar image

Xukapy
138 13 20 30

(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