Flashlight on Mobile Device or Fake Flashlight

Hi Friends Tell ME ho make fake Flash Light for mobile >

??? Help me friends

Try to use couple dynamic pointlights.

but mobile device not support it. i try this but not working :frowning: but now i am finding to make fake light . maybe here someone know how to create fake light for mobile

You can try projecting onto the world using “World Position Behind Translucency”. You should be able to replace the “WorldPosition” node in that thread with WorldPositionBehindTranslucency. Note it won’t be shadowed.


thanks @ its work but no light effect its not working in dark area :frowning:

How did you try to apply it? It should be able to work as a purely emissive effect if you want it to.

i make it the same and apply it with mesh cone attach to player but this not work .
if i did something wrong kindly tell me how to apply this

If you want to use this on a cone mesh, you need to make the mesh translucent and you need to replace “World Position” with “World Position Behind Translucency”.

The version you have above works on actual surfaces. Try putting it on a ground plane that is located at 0,0,0. It might be you placed your cone in the world nowhere near the origin and it is specified to be at 0,0,0 above. You may want to use something like ActorPosition instead of that vector parameter so you can have it follow the object. And same for the direction, you may want to use a local axis. Otherwise you can specify the axis using a material instance dynamic with blueprints.

I am Failed :frowning:

You are setting invalid values for the position and orientation.

First, they need to be vector parameters, not scalar.

Second, you need to hook the whole XYZ value of the position to position, and you need to get the rotation X vector for the direction. You are using the position X value for both which doesn’t really mean anything.

Also, until you change the material to use “World Position Behind Translucency” you need to actually apply this ON the floor material, not on the flashlight beam.

Edit: not sure how you are calling that BP function, but if its on Tick, you don’t want to be creating the MID every frame. Better to pre-create it on begin play and store it to an MID variable.

Thanks again @
i did the same . but still confusing on world position behind Translucency and you said to apply this on floor .

world position behind Translucency mean to change the blend mode to Translucent

The Translucent version is what you would apply to the light beam. It needs to be translucent to get the position of the world to project onto it.

The opaque verison is just meant to be a preview of the effect as a slice going ‘through it’. All you need to do is leave the parameters at the defaults in my original image and place a floor in the world at 0,0,0 and you will see a white cone just like my other image in the thread I linked.

1 Like

thanks now its working :smiley:

Nice but the light beam (the cone mesh) is not “stopped” by other meshes. If you point your flashlight to a wall, the light beam is rendered behind the wall

Yes you would need to do that manually somehow. probably since its mobile you would need to do a line check and stop it using the material with a spheremask or something. do not expect detailed shadowed.

I don’t need dynamic shadows but I’ve read almost all the topics on the forum about “mobile flashlight”, “fake flashlight”, “fake dynamic spotlight” (I still wonder why dynamic point lights are implemented but not spotlight), etc. but unfortunatly I can’t find anything useful.
This iOS game (probably not made with UE4) has a nice flashlight but this look like dynamic spotlight https://youtu.be/qbkqhXofhKA?t=1m7s
I’m looking for something close to this

Looks like a real shadow. you aren’t going to get a result like that without a real shadow unless you make some super custom geometry shader based effect (and UE4 has no pipeline for geo shaders so you’d need to do a lot of c++ first), but those are usually only done in 2d. Not sure if IES profiles work but have you tried them to make a pointlight look like a spotlight?

I had this idea too, something like a cone mask on a pointlight but I really don’t know how. And unfortunalty, IES is not working on mobile.
My first idea was to use a cone mesh and put a pointlight in the mesh because I just don’t know how to do this with material function

ps: Do you have any info about the support of dynamic spotlight for mobile? Is it planned?

The “mesh trick” works on PC. I used a movable point light placed in a cone mesh, checked the “Hidden Shadow” option and hided the mesh and I have a cone of light:


But because dynamic pointlights produce dynamic light but not dynamic shadows, it doesn’t work on mobile.
I tried light function but it look like they don’t work on mobile too