How do I find the height of a gameObject?

I'm doing a raycast to determine if there are intervening models from my turret to its target. My problem is the raycast is sourced from the base of the turret. I want to modify the source transform to take into account my turrets height without manually entering the height of each turret.

Just add a new transform to the object and use its position and forward direction to cast the ray. Bind this in your prefab (or via script, whatever fancies you).

public Transform raycastOrigin;

Then you can use raycastOrigin in your raycast. Just make sure you parent it to the object it should belong to. Instead of using transform.position etc, just use raycastOrigin.position.

How about: