Cant get OnParticleCollison to trigger (Bug?)
Hi guys,
I have done some searching and I'm not able to find my issue solveable.
I have a BulletParticle object, which shoots particles from a Bullet Spawn Point object which is nested inside my players weapon.
I have the particle system setup on the bullet, collision is enabled and Send Collison Messages is checked. I have run checks on my particle emitter, which is working fine. I am unable to get a trigger on OnParticleCollison();
In this case, I am trying to shoot the gun which emits purple particles and have it move a cube.
BulletParticle Inspector
Particle System (Renderer is set to StretchedBillBoard, collison is enabled with world! - collides with everthing)
Particle Direction script (Weapon is set to bullet spawn point)
No collider
Cube Inspector - Box Collider (Is Trigger is not set) - Mesh Renderer - Rigid Body
Here is my code as well.
using UnityEngine;
using System.Collections;
public class ParticleDirection : MonoBehaviour {
public Transform weapon;
// Update is called once per frame
void Update () {
transform.position = weapon.TransformPoint(Vector3.zero);
transform.forward = weapon.TransformDirection (Vector3.forward);
}
void OnParticleCollison(GameObject other)
{
Debug.LogError("Particle collison");
Rigidbody body = other.GetComponent<Rigidbody>();
if (body) {
Debug.Log("Collison", gameObject);
Vector3 direction = other.transform.position - transform.position;
direction = direction.normalized;
body.AddForce (direction * 5000);
}
}
}
Included Images/Video http://imgur.com/a/gvpeo