Flashlight with cone tracer
So, I want to make a system who if I keep pressed a key, the flaslight turn on and makes a tracer with a cone form for detect the player 2 and rest to it some life.
Well, something like this: https://youtu.be/Yd_knjA0WrM?t=4m57s
I don't known if the method used on 'Nintendo Land' programming was adding a hit detector on the light, a multiple light model who reacts on the walls or tracers. (Yeah, im making a copy of Nintendo Land, for mobiles)
I only want to make this system, I tried with adding hitbox to a light 3d model but the light can pass tought the walls. And now I tried with tracers and I when I press the key all works fine, but it generates a trace and the trace is static and doesn't move with the player, and I want when the key is holding-pressed that trace turns-on and follows the player. I don't known if I explained correctly, so I will put some screenshots.
What happens: http://prntscr.com/itf1rz
What it happens when I move: http://prntscr.com/itf26q
What I want: http://prntscr.com/itf33c
Please, help! Im a very-new user on Unreal Engine (And I decided to make a simple game, but the lantern system is the hardest thing of this.)
asked Mar 19 '18 at 06:38 PM in Blueprint Scripting
to duplicate the functionality in the video of healing players in the cone of light i would use a cone shaped mesh to get actors then use a line trace to ensure that they are in visual contact (make sure they arent on the other side of a wall). then have all of this on a timer so that the script can happen many times.
in the picture below youll see how i implemented all of this. on input Q pressed begin a looping timer that fires the check for players event, when the input is released the timer stops. the check for players event get all the actors overlapping the cone mesh, of the type specified in the filter (optional). then it runs each through a for each loop which checks is the target is in visual range via the line trace. then i just added health to the target if it was of a certain type.
answered Mar 19 '18 at 09:55 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here