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"

enable action only when I look at an object

How can I do this action only when I look at the object?alt text

Thanks !

Product Version: Not Selected
Tags:
immagine.png (281.8 kB)
more ▼

asked Nov 06 '14 at 03:01 PM in Blueprint Scripting

avatar image

sbsimosb
0 2 5 8

avatar image smartyMARTY Nov 06 '14 at 03:06 PM

Here is a link of how it is done in C++: http://www.tomlooman.com/tutorial-usableactor-system-in-c/

Look especially at the "*Character.cpp" section of the GetUsableInView() function, as that can easily be translated into BP

And an implementation of it here in BP: http://www.tomlooman.com/tutorial-multiplayer-supported-usableactor-system-in-blueprint/

Finally, It is a simple matter of getting the Camera position and rotation. Casting a ray from that to the first item hit. After that, in the HitResult, cast the returned actor to the object that fires off an event when it is looked at, then call the event function.

avatar image sbsimosb Nov 06 '14 at 07:39 PM

Ok, i followed the instructions and it works, but I can not do trigger the event matinee instead of destroy actor alt text

immagine1.png (265.0 kB)
immagine2.png (188.0 kB)
avatar image Adam Davis STAFF Nov 06 '14 at 08:05 PM

Hi sbsimosb,

Are you calling the destroy actor before you call the matinee? If so you need to do them the other way around, destroy completely stops any functionality after it has been called and should (generally) be placed at the end of a function.

avatar image sbsimosb Nov 06 '14 at 08:15 PM

No, I want to replace the "destroy actor" with an event matinee, can i do ?

avatar image Adam Davis STAFF Nov 06 '14 at 08:22 PM

I would recommend a timeline, but yes you can. If when you look at it you run a "cast to" the object you should be able to access the timeline (which I would set up in the actor in question instead of in your player script).

avatar image sbsimosb Nov 06 '14 at 08:30 PM

basically I need to activate an animation in matinee of an object only when I look at it and press a button. sorry for my english but it is not my mother language :)

avatar image Adam Davis STAFF Nov 06 '14 at 08:49 PM

Your English is very good! You should be able to do a matinee in much the same way. Once the trace hits you can still cast to the object to access the matinee.

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

2 answers: sort voted first

Hi sbsimosb,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance. Thank you.

more ▼

answered Nov 19 '14 at 03:46 PM

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

I'm not sure exactly how to do this, but I saw in another person's tutorial they used something called "Get Actor Forward Vector", which let you do some branching depending on the position of the camera view and the other actor:

http://youtu.be/_ws5Wh1L-zw?t=2m14s

more ▼

answered Nov 06 '14 at 04:16 PM

avatar image

Whitehawk
26 2 6 6

(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