Why it dsnt work? (C#)
What I need to do with it - if ray from “A” script in contact with collider of object attached to “B” script, then in “A” something doing:
Vector3 ray = transform.TransformDirection(Vector3.forward);
Debug.DrawLine(transform.position, ray, Color.green);
pickup = ray.collider.GetComponent<rev_pickup>();
if(pickup != null) { do(); }
Error:
error CS1061: Type UnityEngine.Vector3' does not contain a definition for
collider’ and no extension method collider' of type
UnityEngine.Vector3’ could be found (are you missing a using directive or an assembly reference?)