# Artifacts with the Universal camera and intersecting meshes

**URL:** <https://forum.babylonjs.com/t/artifacts-with-the-universal-camera-and-intersecting-meshes/14995>\
**Category:** Questions\
**Created:** [October 18, 2020, 9:51am UTC](https://forum.babylonjs.com/t/artifacts-with-the-universal-camera-and-intersecting-meshes/14995 "2020-10-18T09:51:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillemCramer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/willemcramer/32/11696_2.png) [@WillemCramer](https://forum.babylonjs.com/u/WillemCramer)\
**Post date:** [October 18, 2020, 9:51am UTC](https://forum.babylonjs.com/t/artifacts-with-the-universal-camera-and-intersecting-meshes/14995/1 "2020-10-18T09:51:41Z")

</div>

Does anyone know the solution to these artifacts happening when meshes intersect?  
Sorry i am new to BABYLON so i paste the code here.  
Any help would be greatly appreciated.

```
var createScene = function () {
var scene = new BABYLON.Scene(engine);

var baseLight = new BABYLON.HemisphericLight("baseLight", new BABYLON.Vector3(0, 10, 0), scene);

var box2 = BABYLON.MeshBuilder.CreateBox("b2", {width:10,height:3,depth:.2}, scene);
box2.rotation.y = Math.PI/4;
var box3 = BABYLON.MeshBuilder.CreateBox("b3", {width:.2,height:3,depth:10}, scene);
box3.rotation.y = Math.PI/4;

var mat1 = new BABYLON.StandardMaterial("textureGrass", scene);
mat1.diffuseTexture = new BABYLON.Texture("textures/grass.jpg", scene);
//mat1.diffuseColor = new BABYLON.Color3(0.89, 0.08, 0.08);

var mat2 = new BABYLON.StandardMaterial("textureWood", scene);
mat2.diffuseTexture = new BABYLON.Texture("textures/wood.jpg", scene);
mat2.diffuseColor = new BABYLON.Color3(0.89, 0.08, 0.08);

box2.material = mat1;
box3.material = mat2;

// FreeCamera >> You can move around the world with mouse and keyboard (LEFT/RIGHT/UP/DOWN)
var freeCamera = new BABYLON.UniversalCamera("UniversalCamera", new BABYLON.Vector3(0, 1, -15), scene);
	freeCamera.attachControl(canvas, true);
	freeCamera.minZ = 0.0001;
	freeCamera.speed = 0.1;
	freeCamera.angularSpeed = 0.025;
	freeCamera.angle = Math.PI/2;
	freeCamera.direction = new BABYLON.Vector3(Math.cos(freeCamera.angle), 0, Math.sin(freeCamera.angle));

freeCamera.attachControl(canvas, true);

return scene;
}
```

---

<div class="post-metadata">

**Author:** ![WillemCramer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/willemcramer/32/11696_2.png) [@WillemCramer](https://forum.babylonjs.com/u/WillemCramer)\
**Post date:** [October 19, 2020, 9:22am UTC](https://forum.babylonjs.com/t/artifacts-with-the-universal-camera-and-intersecting-meshes/14995/2 "2020-10-19T09:22:27Z")

</div>

It has been solved by [Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov) 🙂  
I set the camera .minZ value way to low. Setting it to 0.1 does the trick.

Thank you Evgeni!
