Hi. I am trying to create a laser weapon that shoots out laser ray. The ray would go to infinity but be blocked when it hits enemies. My idea is using a sprite for the ray and scaling it, checking if it collides with enemies. But, I dont know how to get the collision point to rescale the laser sprite to (when the ray hits an enemies, it should be blocked at a point on the shell of that enemy). So, how can I handle this problem? Or is there any way better than the way I use?
Develop games in your browser. Powerful, performant & highly capable.
See capx file from this comment:
This is a popular question, try searching the forum for the word "laser", there may be lots of other solutions.
Thank you! I would try.