Hello,
i want that if my rigidbody collide with some tagged colliders than it spawn the particle system for the tag-
tag wood-wood particles this is my code:
using UnityEngine;
using System.Collections;
public class ImpactScanner : MonoBehaviour {
public GameObject MetalParticles;
public GameObject WoodParticles;
public GameObject DirtParticles;
public GameObject BodyImpact;
public float DestroyTime;
void Start () {
Destroy(gameObject, DestroyTime);
}
void OnCollisionEnter(Collision collision) {
if (other.CompareTag("Metal")) {
MetalParticles instantiatedProjectile = Instantiate(projectile,transform.position,transform.roation) as GameObject;
}
if (other.CompareTag("Wood")) {
WoodParticles instantiatedProjectile = Instantiate(projectile,transform.position,transform.roation) as GameObject;
}
if (other.CompareTag("Dirt")) {
DirtParticles instantiatedProjectile = Instantiate(projectile,transform.position,transform.roation) as GameObject;
}
if (other.CompareTag("Player")) {
BodyImpact instantiatedProjectile = Instantiate(projectile,transform.position,transform.roation) as GameObject;
}
}
}
but i always get this error :(
Assets/FPS REALISM PRO KIT/KerboGames/Scripts/Projectile/ImpactScanner.cs(30,33): error CS0118: `ImpactScanner.WoodParticles' is a `field' but a `type' was expected
and this wich every particles
Have a nice Day
Regards
↧