Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

2D Physics How to create 2D weapon which can pass trough dynamic RigidBodies

Discussion in '2D Experimental Preview' started by TEXTUS, Jun 21, 2016.

  1. TEXTUS

    TEXTUS

    Joined:
    Nov 1, 2015
    Posts:
    1
    I want to create a 2D weapon ( Axe with polygon collider on it ) ,which can interact with any other objects and not affect or change position of Dynamic RigidBodies , and at the exact point of interaction instantiate hit effect ( Sparks for example ) .

    The question is : how to create entity wich will interact with :
    - objects with just colliders on it ( Wall , Ground Vs Weapon)
    - objects with dynamyc RigidBodies ( Enemies , moveable solid objects Vs Weapon) (and not prevent them from moving , not change their position , basicly pass trough them )
    - with themselfs (Weapon vs Weapon)
    But still it need to retrieve exact position of interaction .
    And prefereably it should happen only than object enters other object .

    Its kind of possible in 5.5a but not before . It can be achieved by using Collider2D.cast in FixedUpdate on object with collider2D and kinematic not simulated RigidBody2D and than retrieve position from RaycastHit2D . But it is not exact solution .

    Basicly i need RigidBody (or better just a collider2D) which receive all collision callbacks but still pass trough dynamic simulated RigidBodies , and updates its ContactPoints . Is that possible to impliment in 5.5a ?
     
    Last edited: Jun 21, 2016