Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Problem with wall

Discussion in 'Scripting' started by LucasDaltro, Dec 5, 2010.

  1. LucasDaltro

    LucasDaltro

    Joined:
    Oct 31, 2010
    Posts:
    236
    I think that had posted in the wrong area so i'll post here:
    Ok I design a super-simple level but this have a problem,when my enemy or my player collide with some wall it is dragged out,how can I make that this wall don't be throw at each collision:mad:

    Sorry for my bad English:(
    When I insert a rigidbody+Mesh Collider the same thing happen and when I only insert a Mesh Collider enemy crosses the wall:eek:
     
  2. laurie

    laurie

    Joined:
    Aug 31, 2009
    Posts:
    638
    Why would a static wall, that shouldn't move, need a RigidBody component? You obviously don't want that. So get rid of the rigidbody and concentrate on figuring out why the collision isn't working. The wall should be a static collider; the player may or may not be a rigidbody collider. See the Physics Components documentation for more details.
     
  3. linkthewise

    linkthewise

    Joined:
    Sep 26, 2009
    Posts:
    137
    Remove the rigidbody. Just need the collider, as laurie says you dont need a rigidbody for static asset. You'll use a rigidbody only if you need to apply forces.