- Home /
Decal(bullet mark) on a moving object
Hello friends,
right now i am trying to fire on a moving object and i am instantiating Decal at the point where Physics.Raycast is hitting. i have used a box collider for the enemy. decal(bullet mark) are instantiated at the point where the Raycast hit the collider.
Vector3 contactpoint = hit.point;
Quaternion hitRotation = Quaternion.FromToRotation(Vector3.up, hit.normal);
Transform bull = Instantiate(bulletHole, contactpoint, hitRotation) as Transform;
bull.parent = hit.collider.transform;
if the enemy is still(not moving),it is working well and decal are drawn on the face.but for the moving enemy, the Decal is not Drawn on the collider face. Few are being drawn on the collider face and few inside the collider or below the the texture and i am not able to find the reason.
Your answer
Follow this Question
Related Questions
Moving a point along a plane, mesh, or collider 1 Answer
Raycast/Non-Physics Collider Discrepancy 0 Answers
My player glitching on moving collider 0 Answers
Raycast missing moving Collider 1 Answer