- Home /
Drawing sprite along colliders
Hi, I am having problem with realistic laser pointer. I am trying to create real moving laser in my VR game and I am using texture of laser dot, placing it wherever the laser hit:
However as you can see there is a problem on the edges, and it looks bad. I would like to get similiar effect to the spotlight:
How can I modify the mesh /or sprite to draw it on the collider? I guess drawing on mesh is not the solution, because I it would be very complicated if I have 2 objects (like pillar and wall, 2 different objects) and laser hit both. Can i somehow draw it in the shape of colliders? Or is there any other known solution for showing laser sight on mesh?
Thanks in advance for any answers!
PS. I tried spotlight with cookie, but you have minimum spot angle, that is too big for me and it looks bad (laser point don't scale up with distance like spotlight), not to mention problems with texture colors. Also used projector, but can't get around texture showing on both sides of the object (no matter the size of far clip plane, it always go through the object texture it is projected on).
Answer by phrobion · Jul 07, 2021 at 02:07 PM
Maybe I am "a bit" late, but I accidentially found your question as I was searching for using cookies in spotlights on URP (I also want a laserdot).
I solve my spotlight-problem like this: Don't position your spotlight at your gun. If you don't want your spotlight to scale up with the distance then move your spotlight along your ray and always position it in front of the hit point.
Works for me but I still can't use cookies in URP-spotlights :(
Your answer
Follow this Question
Related Questions
Call different geometry shader functions, for different primitive type: How? 1 Answer
Some textures not affected by light? (With screenshots) 5 Answers
Transparency and URP for Oculus Quest 1 Answer
What kind of values come out of _WorldSpaceLightPos0? 1 Answer
Smooth text disappear after erased like in old monitors. 1 Answer