- Home /
Why does my skript not work?(Particles)
Why does my skript not work?
I want that the skript notice, if a particle collide with it, but it doesent work.
using UnityEngine; using System.Collections; using System;
public class Ifshooted : MonoBehaviour {
private bool firstHit;
public Transform flammen;
public void Hit(){
if (firstHit == false)
{
Instantiate(flammen, new Vector3(0, 0, 0), Quaternion.identity);
firstHit = true;
}
}
}
Thanks for our answer
Merlin
$$anonymous$$aybe this link can help you?
http://docs.unity3d.com/Documentation/Components/class-WorldParticleCollider.html
Good luck! :)
Answer by PemuG · Jul 23, 2013 at 01:30 PM
Try this (I create JS script):
private var firstHit : boolean = false;
var flammen : Transform;
var flame : ParticleRenderer;
function Update(){
if (firstHit == false)
{
Instantiate(flame, transform.position, transform.rotation);
firstHit = true;
}
}
You must include Particle System in flame. Good Luck ;)
Srry but i dont understand your skript.
I want to make a skript with imports a prefab of a flame, when it is being shooted by the player
Your answer
![](https://koobas.hobune.stream/wayback/20220613110651im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Enabling and Disabling Shurken Particles 1 Answer
How do you make a particle effect always emit upwards? 2 Answers
disabling shadow casting with SSE 0 Answers
Shuriken values in shader code? 0 Answers