You’re best off using raycasts.
Use the idea of multipliers
Get the hit object.
Determine if it has health, if not don’t do anything (e.g return from a function)
Have a damage constant, like 1.0 and multiply it by the weapon damage constant, which could be 1.5
Subtract that value from the enemies health.
Set the health on the enemy
Yes, i could do it, but if multiple enemies on the screen, how do i decrease the life of the enemy that i am raying? I need somehow to determine which is the current enemy that is rayed, i have no idea.
where object and other_object are GameObjects respectively,
and distance set to a range (int or float)
and property can be set to only trigger if an object with a certain property is hit.