Hi,
I followed the spawn decal on mouse click tutorial. I used that code inside a ray cast hit. I got very strange decal spawn on hit point position. This is the ray cast code -
if(Physics.RayCast(cameraHead.Position, cameraHead.Direction, out hit, shootingRange)))
{
var decal = Scene.AddChild<Decal>();
decal.Position = hit.Point;
decal.Material = baseMaterial;
decal.Direction = hit.Normal;
}
See the attached image.
The red circle is the actual decal which I created in the editor. The decal from the code should look like it. But after ray cast the decal looks like the left image. Right image is the actual texture that I used for the decal. Any help!!