Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

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

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



    Nov 1, 2015
    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