Decal help please :)

Hey Guys i just made a script which shoots at a object with a rigid body and applies force to it. I just started to make it leave a decal once i shoot but it shows no decal when i shoot :slight_smile: can you please help me with this thank you :slight_smile:

here is the script :

var woodPartical : Transform;


function RayShoot (){

    GameObject.Find("m1911pistoleReloadandShooting").animation.Play("Shoot");
		var hit : RaycastHit;

				var DirectionRay = transform.TransformDirection(Vector3.forward);
				
				Debug.DrawRay(transform.position , DirectionRay * Range , Color.blue);
				if(Physics.Raycast(transform.position , DirectionRay , hit, Range)){
				
				var rotation = Quaternion.FromToRotation(Vector3.forward, hit.normal);

					var collided = hit.point;
					
				if(hit.rigidbody){
				
				hit.rigidbody.AddForceAtPosition( DirectionRay * Force , hit.point);
				
				if(hit.transform.tag == "Enemy"){
				
				var Woodpar = Instantiate( woodPartical, collided , rotation);
				
				Woodpar.transform.parent = hit.transform;
				    
				    
				
				}
				    hit.collider.SendMessageUpwards("ApplyDamage" , damage , SendMessageOptions.DontRequireReceiver);
				}
				
				
				}
				
				BulletsLeft --;
				
				if(BulletsLeft < 0){
				
				BulletsLeft = 0;
				
				}
				
				if( BulletsLeft == 0 ){
				
				Reload();
				
				
                }
                
				}

please do remember that i have only given the part that makes the script shoot :slight_smile:
thank you in advance MCHALO

Besides the fact that you don’t seem to be instantiating a decal (2d texture), but a ‘particle’ prefab, your code should work all right for what I see.

I suggest you change your ‘woodPartical’ prefab in the inspector with a SPHERE mesh primitive of adequate dimensions (usually the default 1 sized primitives are well visible on the scene).
If the sphere appears on hit, then it’s clearly your ‘woodPartical’ prefab the culprit.
If the sphere doesn’t appear, there could be a simple layer assignment issue to check (assure that the camera is actually culling or not the particle effect layer).