Triggering Events using Line Trace
Hi, quick question how can I set up two different triggers/object in one blueprint so when one of them gets hit by the line trace it runs action A and another action B?
Example: I would like to use door in two different ways. First when I look at the door handle I can do action A (open door) and by looking at the knocker I can do action B (knock on the door).
I know how to do this using overlap event but is it possible to achieve same effect using line trace?
thx in advanced.
asked Dec 15 '18 at 11:18 AM in Blueprint Scripting
hey there! you need to use an interface (https://www.youtube.com/watch?v=G_hLUkm7v44).
It's a blueprint type asset you can implement on actors that you want to be able to use it. The interface can have a pre-set function, lets call it "React", now any actor that implements the interface can place a "Event React" on their graph.
The magic of interfaces is that when you call it, and the other actor has it, it just works.
So when you trace you get a HitActor return. On that actor you call "interface call React". if the actor has the interface implemented, it'll trigger its "Event React" event.
answered Dec 15 '18 at 03:24 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here