First sorry for my english, I’m searching this bug for 2 days.
I have a video about this problem. I’ll attach 1
I just want to make bullet holes. When I fired creates a bullet hole but in different position.
I tried everything… i can’t resolve this problem.
RaycastHit hit;
//Vector3 fwd = Kamera.TransformDirection (Vector3.forward);
Ray ray = new Ray(Kamera.position,Kamera.forward);
if (Physics.Raycast(ray,out hit,10f)) {
Quaternion hitrotation= Quaternion.FromToRotation(Vector3.up, hit.normal);
Instantiate(iz,hit.point,hitrotation);
Debug.Log (hit.point);
Debug.Log(Kamera.position);
Debug.Log(hit.collider.name);
}