Weapon Hit Points

Hey everyone got a quick question, so I have beam weapons that are really just lines drawn to the target and make the target get damage. It works perfect however I have one small problem. I have multiple of the same weapons on my ship in different locations that fire at the target but the end points all end up at the same central location of the transform of the enemy ship. How may I change this so that all the weapons don’t shoot the same location? I was thinking Random.Range but I use this same script to fire on all different types of ship models in which are all different sizes. Anyways I am all open here to suggestions. Also if you don’t mind maybe showing me some sudo code as I am not really used to unitys c# functions.

This is a part of my beam code…


Couple of options.

  1. You could aim all weapons in the same direction. The beams will then be split by the distance between the origins
  2. You could do something with collider bounds
  3. You could add multiple empty gameobjects to your target to use as pretend targets
  4. You could use your solution add a bit of randomness to you code