Search Unity

Collision Problem

Discussion in 'Scripting' started by Unity_gamer, Sep 13, 2011.

  1. Unity_gamer

    Unity_gamer

    Joined:
    Aug 19, 2011
    Posts:
    30
    Hi all,

    I am trying to create FPS melee weapon in my project .The weapon that am trying to create is a Driller.Earlier when i started doing i was facing one problem ,the weapon that is attached with the player does not have any collision so during the Weapon fire animation the weapon will pass through the wall.
    I solved that problem by keeping the Weapon as different layer.But now am facing another problem.
    Now On trigger enter is not working with the Weapon.What i need to do is ,during fire button press Animation will play and that time if the weapon is near the Wall i need to show Drill hole on the Wall.
    For doing this i need ON tigger enter working .In this case it is not working and am not able to detect the Collision between two objects.
    What exactly i need to do solve this.How can i detect the trigger?

    Thanks for any help,
     
  2. foobar

    foobar

    Joined:
    Jan 28, 2010
    Posts:
    90
    Is there a rigidbody component attached to either the wall or the weapon? If there isn't at least one rigidbody among the two objects, no collision will be registered.