- Home /
scripts for collision not working
I'm having a problem with my game. I have a forklift truck and attached to it is a gameObject. I wrote a script that when the forklift collides with a fire particle, the gameObject is deactivated and points are added. Here's the code:
function OnParticleCollision(touch : GameObject){
if(touch.gameObject.name == 'Flames' && copperCubes.active ==true){
Points.myPoints += 10;
}
Now the code works fine until I restrict the forklifts rotation on the x and z axis. If I restrict it's rotation there doesn't seem to be any collision being detected. How do I get around this?
Your answer
Follow this Question
Related Questions
Physics.OverlapSphere() not working after using pool of objects 0 Answers
Ignore awake function call to destroy game object if character enters trigger 1 Answer
How could it be done "Cooldown" for a shield ? 2 Answers
Why doesn't this script work?? Please help.. 1 Answer
Is there any way to convert Collision to a Gameobject or Transform? 1 Answer