Search Unity

Struggling with colliders

Discussion in 'Getting Started' started by piruelain, Feb 11, 2019.

  1. piruelain

    piruelain

    Joined:
    Feb 8, 2019
    Posts:
    4
    Hello!

    I'm new to Unity and this forum so please forgive me if I'm placing this question to a wrong forum :)

    I started to investigate Unity only recently but I can understand the basics, project structure, gameobjects etc generic concepts. Succeeded to build a game prototype with basic 3D models (spheres, cubes etc) and it worked well.

    Now I want to proceed introducing new models to my new projects to make it look more realistic and pleasurable (ie Zombie). But there's one thing which I can't quite understand yet - colliders. As long as I'm using models which have standard shape (ie box or sphere) it works nicely but I can't get collider around some other objects (ie that Zombie model) so that it won't fall through floor and it's animations won't stop or get messy :) Although by naked eye it looks like collider's bottom does match the level of model's bottom like it is for Ethan.

    I think I must be missing something important as when I look at standard asset model Ethan, its collider seems to be exactly in place but when I try to place it on my own to another model, it doesn't work. Is there a way how to ensure that the collider really is placed correctly (other than just guessing the numbers) and what else should I pay attention to ?

    Thanks in advance!
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Colliders are usually placed just by eyeballing them. The exact placement isn't critical; if it's a little too low or too high, then your model will rest on the ground a little too low or too high. Just adjust it until you like the way it looks.
     
    Kiwasi and piruelain like this.
  3. piruelain

    piruelain

    Joined:
    Feb 8, 2019
    Posts:
    4
    Thanks, I figured it out now and it worked as expected but it seems like I didn't state correct question at all :) Problem seems to be with my model or some other yet unknown aspect for me. Collisions now do work as expected but the problem is related to applying root motion in animator - character fells down on its face as soon as it starts its first animation (unchecking that fixes thing but it probably isn't what I'd want in longer term?). Do you happen to know what to check next? I guess I don't yet know much enough to even google it correctly :) (my goal is to create a NPC with some script and so that it considers physics and environment in my later iterations of the product)
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Root motion is a pain. If you can get by with leaving it off, I recommend doing so. Unless, of course, you have a bunch of animations all designed to work with root motion, so that everything Just Works swimmingly... but it sounds to me like you don't.
     
    piruelain likes this.
  5. piruelain

    piruelain

    Joined:
    Feb 8, 2019
    Posts:
    4
    Thanks a lot for replies! I made some progress to the level where I can continue with simpler behaviour of my NPCs before I dig deep into more complex stuff :) Locking X and Z of the rigidbody seems to serve my initial purposes and I'll investigate about root motions later when I really need them and have more knowledge in overall.