- Home /
ParticleEmitter 'emit' error
I just import Realistic.FPS.Prefab.v1.23 then i got Errors:
1) Assets/RFPSP/Scripts/Effects/WeaponEffects.cs(201,91): error CS1061: Type UnityEngine.ParticleEmitter' does not contain a definition for Emit' and no extension method Emit' of type UnityEngine.ParticleEmitter' could be found. Are you missing an assembly reference?
2) Assets/RFPSP/Scripts/Objects/!Destructibles/BreakableObject.cs(37,41): error CS1061: Type UnityEngine.ParticleEmitter' does not contain a definition for particleCount' and no extension method particleCount' of type UnityEngine.ParticleEmitter' could be found. Are you missing an assembly reference?
3) Assets/RFPSP/Scripts/Objects/WaterZone.cs(136,16): error CS1061: Type UnityEngine.ParticleEmitter' does not contain a definition for emit' and no extension method emit' of type UnityEngine.ParticleEmitter' could be found. Are you missing an assembly reference?
4) Assets/RFPSP/Scripts/Objects/WorldRecenter.cs(36,18): error CS0246: The type or namespace name Particle' could not be found. Are you missing an assembly reference? 5) Assets/RFPSP/Scripts/Objects/WorldRecenter.cs(37,37): error CS0841: A local variable emitterParticles' cannot be used before it is declared
6) Assets/RFPSP/Scripts/Objects/WorldRecenter.cs(41,21): error CS1061: Type UnityEngine.ParticleEmitter' does not contain a definition for particles' and no extension method particles' of type UnityEngine.ParticleEmitter' could be found. Are you missing an assembly reference?
7) Assets/RFPSP/Scripts/Player/FPSPlayer.cs(1171,104): error CS1061: Type UnityEngine.ParticleEmitter' does not contain a definition for Emit' and no extension method Emit' of type UnityEngine.ParticleEmitter' could be found. Are you missing an assembly reference?
8) Assets/RFPSP/Scripts/Weapons/WeaponBehavior.cs(1397,31): error CS1061: Type UnityEngine.ParticleEmitter' does not contain a definition for Emit' and no extension method Emit' of type UnityEngine.ParticleEmitter' could be found. Are you missing an assembly reference?
Here's the attachment alt text
Scripts: } }else{ if(defaultImpactSoundsMelee[0]){ hitSound = defaultImpactSoundsMelee[Random.Range(0, defaultImpactSoundsMelee.Length)];//select random impact sound for this surface type } } break; }
     impactObj.transform.position = hitPoint;
     if(rayNormal != Vector3.zero){
         impactObj.transform.rotation = Quaternion.FromToRotation(Vector3.up, rayNormal);
     }else{
         impactObj.transform.rotation = Quaternion.Euler(Vector3.up);
     }
     if(impactObj.GetComponent<ParticleEmitter>()){impactObj.GetComponent<ParticleEmitter>().Emit();}
     foreach (Transform child in impactObj.transform){//emit all particles in the particle effect game object group stored in impactObj var
         child.GetComponent<ParticleEmitter>().Emit();//emit the particle(s)
     }
     
     //modify the weapon impact sounds based on the weapon type, so the multiple shotgun impacts and automatic weapons aren't so loud
     if(!NpcAttack && !WeaponBehaviorComponent.meleeActive){
         if(WeaponBehaviorComponent.projectileCount > 1){
             hitVolumeAmt = 0.2f;    
         }else if(!WeaponBehaviorComponent.semiAuto){
             hitVolumeAmt = 0.8f;    
         }else{
             hitVolumeAmt = 1.0f;
             }
             //drop arrows if object is destroyed
             ArrowObject[] arrows = gameObject.GetComponentsInChildren<ArrowObject>(true);
             foreach (ArrowObject arr in arrows) {
                 arr.transform.parent = null;
                 arr.myRigidbody.isKinematic = false;
                 arr.myBoxCol.isTrigger = false;
                 arr.gameObject.tag = "Usable";
                 arr.falling = true;
             }
             if(breakParticles && breakParticles.particleCount == 0.0f){
                 Destroy(myTransform.gameObject);
                 yield break;
             }
         }
         yield return new WaitForSeconds(0.1f);
     }
 }
 
 public void ApplyDamage (float damage){
     hitPoints -= damage;
     if(hitPoints <= 0 && !broken){
         if(breakParticles){
             breakParticles.Emit();//emit broken object particles
         }
         if(GetComponent<AudioSource>()){
             GetComponent<AudioSource>().pitch = Random.Range(0.95f * Time.timeScale, 1.0f * Time.timeScale);//add slight random value to breaking sound pitch for variety
             GetComponent<AudioSource>().Play();//play break sound
         }
         //disable mesh and collider of glass object untill object is deleted after sound effect finishes playing
 }
     //store original sun/directional light color
     if(SunlightObj){origSunightColor = SunlightObj.color;}
     
     rippleEffect.emit = false;
     if(waterPlane){
         waterPlane.gameObject.SetActive(false);
         underwaterYpos = waterPlane.transform.position.y;
     }
     if(useCausticsLight && causticsLight){
         causticsLight.gameObject.SetActive(false);
     }
     if(waterPlaneTop){waterPlaneTop.gameObject.SetActive(true);}
     
     swimTimeState = false;
     rippleEffect.emit = false;
     particlesEffect.emit = false;
     FPSWalkerComponent.inWater = false;
     FPSWalkerComponent.swimming = false;
     FPSWalkerComponent.belowWater = false;
     FPSWalkerComponent.canWaterJump = true;
     FPSWalkerComponent.holdingBreath = false;
     
     if(frames.Length > 0){
         InvokeRepeating("NextFrame", 0f, 1.0f / fps);
     }
     
 }
 
 void Update(){
 
     if(!playerObj.activeInHierarchy){
         swimTimeState = false;
         rippleEffect.emit = false;
         particlesEffect.emit = false;
         FPSWalkerComponent.inWater = false;
         FPSWalkerComponent.swimming = false;
         FPSWalkerComponent.belowWater = false;
         FPSWalkerComponent.canWaterJump = true;
         FPSWalkerComponent.holdingBreath = false;
         StopUnderwaterEffects();
     }
     
     if(!myTransform.GetComponent<Collider>().bounds.Contains(mainCamTransform.position - (mainCamTransform.up * 0.2f))){    
         StopUnderwaterEffects();
     }else{
         StartUnderwaterEffects ();
 }
             //recenter particles and particle emitters
             objects = FindObjectsOfType(typeof(ParticleEmitter));
             foreach (Object o in objects)
             {
                 ParticleEmitter pe = (ParticleEmitter)o;
                 Particle[] emitterParticles = pe.particles;
                 for(int i = 0; i < emitterParticles.Length; ++i)
                 {
                     emitterParticles[i].position -= cameraPosition;
                 }
                 pe.particles = emitterParticles;
             }
             
             //Refresh terrain to update tree colliders (can cause momentary hiccup on large terrains)
             if(refreshTerrain){
                 if(Terrain.activeTerrain){
                     TerrainData terrain = Terrain.activeTerrain.terrainData;
                     float[,] heights = terrain.GetHeights(0, 0, 0, 0);
                     terrain.SetHeights(0, 0, heights);
                 }
             }
         }
     }
 }
}
         Vector3 toTarget = (attacker.position - transform.position).normalized;
         blockAngle = Vector3.Dot(toTarget, transform.forward);
         
         if(Vector3.Dot(toTarget, transform.forward) > WeaponBehaviorComponent.blockCoverage){
         
             damage *= 1f - WeaponBehaviorComponent.blockDefenseAmt;
             otherfx.clip = WeaponBehaviorComponent.blockSound;
             otherfx.PlayOneShot(otherfx.clip, 1.0f);
             
             if(blockParticles){
                 blockParticles.transform.position = Camera.main.transform.position + Camera.main.transform.forward * (blockParticlesPos + CameraControlComponent.zoomDistance + CameraControlComponent.currentDistance);
                 if(blockParticles.GetComponent<ParticleEmitter>()){blockParticles.GetComponent<ParticleEmitter>().Emit();}
                 foreach (Transform child in blockParticles.transform){//emit all particles in the particle effect game object group stored in blockParticles var
                     child.GetComponent<ParticleEmitter>().Emit();//emit the particle(s)
                 }
             }
             blockState = true;
         }
     }
     
     timeLastDamaged = Time.time;
     Quaternion painKickRotation;//Set up rotation for pain view kicks
     int painKickUpAmt = 0;
     int painKickSideAmt = 0;
             }else{
                         if(barrelSmokeTime + 0.5f > Time.time){
                             if((!InputComponent.fireHold 
                                || IronsightsComponent.reloading
                                //emit particles if player is still holding fire button and fire time has elapsed for semi auto
                                || ((Time.time - shootStartTime > 0.1f) && InputComponent.fireHold))
                                && lastMeleeTime + (meleeAttackTime * 2f) < Time.time
                                && !FPSWalkerComponent.sprintActive){
                                 if(!FPSPlayerComponent.zoomed || WeaponPivotComponent.deadzoneZooming){
                                     barrelSmokeParticles.transform.position = mainCamTransform.position + (mainCamTransform.right * barrelSmokeOffset.x) + (mainCamTransform.up * barrelSmokeOffset.y) + (mainCamTransform.forward * smokeForward) + (weaponLookDirection * barrelSmokeOffset.z);//muzzleFlash.position;
                                 }else{
                                     barrelSmokeParticles.transform.position = mainCamTransform.position + (mainCamTransform.forward * smokeForward) + (weaponLookDirection * barrelSmokeOffset.z);//muzzleFlash.position;
                                 }
                                 barrelSmokeParticles.Emit();
                             }
                         }else{
                             emitBarrelSmoke = false;    
                         }
                     }
                 }
                 
                 //reset bulletsJustFired value when not firing after a time
                 if(Time.time - shootStartTime > fireRate + 0.2f){    
                     bulletsJustFired = 0;    
Your answer
 
 
             Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Need help with controller script. 1 Answer
Input for bluetooth controller? 0 Answers
How can i make my player stick with moving platforms? 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                