Hello,
I’m using a Transform to reference where I want to cast a ray from:
var referenceObject : Transform;
if(Physics.Raycast (referenceObject.transform.position, direction, hit))
But I want to be able to also dynamically change the position slightly within the code. For now, just add 3 onto the Z axis:
var firePos = referenceObject.transform.position;
var lineStartPos = Vector3(firePos.x, firePos.y, firePos.z + 3);
The only problem with that code, is that its in world space, and not local to the referenced object.
How would I fix this?
Thanks