How Can I Adjust My Ray Cast Position Upwards?

Hello,

How would I go about making this line of code move my ray cast +10 up (y):

var direction = transform.TransformDirection(Vector3.forward); var hit : RaycastHit; var localOffset = transform.position + transform.up * 10;

// Did we hit anything?
//transform.position + transform.up * 10
if (Physics.Raycast (localOffset, direction, hit, range) && MachineGun == true) {
     Debug.DrawLine (transform.position, hit.point);
    // Apply a force to the rigidbody we hit
    if (hit.rigidbody)
        hit.rigidbody.AddForceAtPosition(force * direction, hit.point);

so in the transform.position (I would imagine), I want something like:

transform.position + 10 on Y axis

So it would move my ray cast up slightly, right?

Cheers

How would I go about making this line of code move my ray cast +10 up (y):

Just add 10 up?

// 10 world units up:
var worldOffset = transform.position + Vector3.up * 10;
if (Physics.Raycast (worldOffset, direction, hit, range)

// 10 local units up:
var localOffset = transform.position + transform.up * 10;
if (Physics.Raycast (localOffset, direction, hit, range)