Right now I’m just getting the transform of a child object because I couldn’t figure this out. I want to use the transform of the current object script is on but first move it back a few units (along the objects Z axis) before using it.
void Raycast()
{
if (current_Target != null)
{
transform.LookAt(current_Target.transform);
Transform ray_Pos = transform.GetChild(0);
RaycastHit hit;
Ray ray = new Ray(ray_Pos.position, transform.forward);
if (Physics.Raycast(ray, out hit, 2f, 1024))//layer Enemies
{
Remove_Projectile();
}
}
}