Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

No Colliders Work

Discussion in 'Editor & General Support' started by TheRedGuy90, Mar 11, 2016.

  1. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    They all go through each other.

    It doesn't matter. Mesh, box, sphere...
     
  2. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    How are you moving your objects?
     
  3. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    With a basic c# script.

    if (Input.GetKey(KeyCode.RightArrow))
    {
    gameObject.transform.Translate(moveSpeed * 1f,0,0);
    }

    etc., etc...
     
  4. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,967
    Try changing things.
     
  5. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    Like how? Move the objects? I've done that.

    Change the script?...
     
  6. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    Still nothing.
     
  7. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,967
    No one can answer your questions because you provided no details. If you want help, you need to describe what is happening, what you are expecting to happen, what you have tried, what/why it didn't work. Screen shots/video are a good idea as well. You have said "colliders don't work", that doesn't mean anything, there could be dozens, if not hundreds of reasons why they don't work. We can't read minds.
     
  8. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    I have trouble uploading screenshots, until I do that here's a detailed description:

    I have a number of meshes for boulders, hills, mountains, etc. on my Scene.
    They have been given meshcolliders.

    My character has a basic Box Collider, however my character just walks through every single collider.

    I even tested this on a new project, with two cubes, one given a movement script. Still nothing. The cube (both have box colliders) just goes through the other cube.

    Does this have something to do with my movement script????


    I can post that up.
     
  9. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,967
    Does your character have a rigidbod? Or do your other object have rigidbodies?
     
  10. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    The character does have a rigidbody. The others don't.
     
  11. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,967
    Well, first, Translate() will be a problematic, you want to use AddForce() on the rigidbody or similar to use the physics for motion, otherwise it will behave very oddly. (it will keep pushing through). But it sounds like something else is going on because if it were working, even with translate, you would get jittering or some other odd movement, not just passing through. I just tried it on a new scene and it worked fine. Check your physics settings under project, and make sure that nothing is being ignored.

    Post a screen shot of the inspector on your character, so we can see the physics settings, and the other parts as well.
     
  12. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
  13. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    (This Forum wont let me post photos without links.)
     
  14. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,967
    if you just drag the image into the post box it will upload the image.
     
  15. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    Here
     

    Attached Files:

  16. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    - Add a rigidbody to it
    - Try Collision continues
    - Try slowing down the collision.
    - Is trigger on?
     
  17. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    I read that "trigger on" turns the collision off and makes it an event, no triggers are on.

    Collision continuous? it's set in the character. How do I slow the collision down..... the way I walk through it?

    Adding rigidbody didnt affect it

    I've already reported a bug...... they havent responded. its been almost 2 weeks
     
  18. dinaga

    dinaga

    Joined:
    Oct 19, 2015
    Posts:
    8
    I had a similar problem, adding rigidbodies to the objects and making sure triggers aren't enabled solved the issue.
     
  19. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    Do I need to add a material to it???
     
  20. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,967
    No, you don't need a physics material. You can if you want to refine the interaction, but they are not required. Also, it isn't a bug, so it is unlikely that you will get a feedback/respose from a bug report.

    In the screen shot, you have have the collider turned off and you have the rotation and position frozen. This would definitely affect the collision, especially combined with using translate to move it.
     
  21. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    That's the rigidbody on my character. Every time I dont check those boxes, my character just floats upward.......
     
  22. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    Okay..... Update.

    I unchecked every box. My character FLEW across my scene, and bumped into the wall. So, there we go.

    But why is it flying all over the place????
     
  23. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    The other thing I may do is write a script that simulates a collider. (Ive been working on a 2D game in a 3D environment, Mode 7 type, but been making the game in 3D Mode..... I may need to redo everything in 2D.)

    Is there a way to get the directions, whatever they may be, my character is going in when I touch the mesh collider (as a trigger?)
     
  24. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    Still dealing with Physics
     
  25. TheRedGuy90

    TheRedGuy90

    Joined:
    Dec 5, 2014
    Posts:
    117
    "Check inside Edit > Project Settings > Physics. There could be something wrong with your physics there. Might also be the objects are penetrating so they are pushed out of each other which results in some objects being thrown into space."

    I read this somewhere. Is this what's happening? All of my meshes are convex and have many vertices/triangles