Ok I'm getting a really weird error. I have 2 codes, 1 is a gun script to shoot and another is a ragdoll script for my zombie that I'm shooting. When I raycast and hit a zombie, I use
if (hit.transform.GetComponent()) {
hit.transform.GetComponent().raycastDirection = transform.position;
}
For some reaon, it keeps saying it can't convert Vector3 to Trasform. Obviously it says transform.position above. So why isn't this working?
Thanks for anyone who can figure out the problem. All of these variables are transforms, not vector3's.
↧