- Home /
particle collision with objects not working.
I have been trying to get particle collision with objects working for ages now. Here is how I have the object im shooting at setup
my particle effect which I want to act as bullets bouncing off the object is as follows:
Here is how I am moving the object my 'second enemy' script shown in the screenshot.
#pragma strict
var positionY : float;
var positionX : float;
var endTime : float;
var speed : float;
function Start () {
positionY = Random.Range(5, 8);
// minimum of -2.618306 and maximum x position of 1.24835
positionX = Random.Range(-2.618306, 1.24835);
speed = Random.Range(1, 2);
transform.position.x = positionX;
}
function Update () {
speed += 0.001;
positionY -= 0.01*speed;
if(positionY < -3.38){
positionY = Random.Range(5, 8);
// minimum of -2.618306 and maximum x position of 1.24835
positionX = Random.Range(-2.618306, 1.24835);
speed = Random.Range(1, 2);
transform.position.x = positionX;
randomPositionX();
}
transform.position.y = positionY;
}
function randomPositionX () {
positionX = Random.Range(-2.618306, 1.24835);
transform.position.x = positionX;
}
Please help me figure out how to get the particles to collide with all objects in the game. At the moment they are just going straight through objects :(. everything.
Your answer
Follow this Question
Related Questions
Detecting collision between particle and player. 2 Answers
Inconsistent Particle Collision detection 0 Answers
Unity 2D Particle System's collider doesn't trigger other colliders for scripts. 0 Answers
How to detect that particle collided with other particle from thesame Particle System (workaround?) 0 Answers
Which particle system does unity use? 0 Answers