- Home /
Cubes wont Collide
Hello, I am having a little problem with my project I am trying to do. I am trying to have two objects collide with each other and it keeps passing through each other. For example, I two cubes in the scene and when I use the "OnMouseDrag" function to move the cubes, it just passes through each other and wont collide. I tried everything but nothing seems to work. I tried the mesh collider but I dont think I am doing it correctly. My objective is to have the objects (cubes in this case) not to collide. Can anyone please help me identify the problem? Thanks
Here is the code:
function OnTriggerEnter(collision: Collider){
if(collision.gameObject.tag == "blue"){
print("blue");
}
function OnMouseDrag(){
if(collision.gameObject.tag == "blue"){
print("blue");
}
function OnCollisionEnter(collision: Collision){
if(collision.relativeVelocity.magnitude > 1)
{
print("excellent");
}
Answer by NAKAS · Jan 26, 2013 at 05:50 AM
The problem seems to be that you have a mesh collider instead of a box collider.
Your answer
Follow this Question
Related Questions
Collision details 1 Answer
Call a Void on Collision 2 Answers
Problems When Shooting Multiple Enemies round about 4 times 1 Answer
How to make arrow stick to environment ? 3 Answers