Is it possible to use lineTraceByChannel on diferent actors?
i am doing an Archviz project an i want to slide doors only when i look at them inside a colision box, my problem is i only can do this with a single actor.
when i add diferent actors linebytrace stops working
Is it possible to use lineTraceByChannel on diferent actors?
The answer is yes, it’s possible. It’s somewhat hard to understand what is not working for you. Care to share more details?
an i want to slide doors only when i look at them inside a colision box
How does this bit work? Each door has its own overlapping collision volume; while the player is inside of it and is looking at the door, the door opens?
Any reason why you cannot simply reduce the length of the trace?
My problem is when i create another actor i cant make it to work because i dont know how to cast linetraceByChannel to multiple actors.
You have options:
use Inheritance:
– implement functionality in the parent class, you will only need to cast to the parent class and all children will understand the function call.
use an Interface - this way you do not need to cast at all:
– send a generic message target actors can interpret. Especially useful when actors that do not share functionality - like a Tree and a Door - they have little in common. An interface would allow you to send the same message to both.
ok so insted of casting to a specific actor if i use an interface all actors will understand even if they do diferent things like sliding door and a opening rotating one?