Hi.
There is a part in my script where I need to make a ray from my mussel to enemy. This enemy could be anywhere around player. I found my ray is not moving to target position !.
public Transform target,Bullet_position;
void Update {
if (target != null)
{
RaycastHit hit;
if (Physics.Raycast(Bullet_position.position, target.position, out hit, 500))
{
Debug.DrawRay(Bullet_position.position, target.position, Color.blue, 500);
if (hit.collider.tag == "enemy")
{
print(" In Range and i can see you! ");
}
else
{
print(" None!! ");
}
}
}
else
{
}
}