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