Laser Enemy Script

Hello,

I’m struggling to write a script for a laser in a 2d platformer. I just want it kill the player on impact. Please help.

your question is too generic… what is the part you struggle with? drawing a line from point A to point B ? or you need specific AI or behaviour for the laser ?

Chances are the laser and the “impact” are going to be two entirely different things. Or let me put it this way: the laser itself is a graphical effect, and the “impact” is a hit effect (most likely a raycast or the instantiating of a collider with an OnCollission effect of doing damage). You can split up the elements you’re searching for to make the search easier, for instance scripts for guns (any guns) will have exactly the kind of hit effect you need, while graphical effects are a dime a dozen. Have fun!

i am sort of a noob, do you know any good tutorials where i could learn that stuff

Sure!

https://www.google.com/search?q=unity+gun+fire+tutorial

https://www.google.com/search?q=unity+laser+tutorial