Search Unity

Detect a melee attack or a punch(Enemy animated attack) without rigidbody

Discussion in 'Scripting' started by KutlayMD, Jan 14, 2019.

  1. KutlayMD

    KutlayMD

    Joined:
    Jul 2, 2017
    Posts:
    5
    Hi
    I am using behaviour designer for enemy AI and character controller for player movement.
    I want to detect when the enemy's punch on my player's face so that I will know my player has taken damage.
    I tried triggers and collision but it did not work for me.
    Can someone help me?
     
  2. romatallinn

    romatallinn

    Joined:
    Dec 26, 2015
    Posts:
    161
    I don't know much about the behaviour designer, but I'll try to help.

    At first, why don't you want to have RigidBody on the object? You can disable all physics if you don't need it.
     
  3. KutlayMD

    KutlayMD

    Joined:
    Jul 2, 2017
    Posts:
    5
    Thank you for replying me :)
    Can you explain how can i do this with rigidbody? I have tried with rigidbody and as you said disabled all physics but it did not work for me.

    Bay the way,when my enemy character hit the player it also pushed the player it means there is a collision but i can not read it from script.