Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Use Rigidbody only to move object but not to interact (push away) others.

Discussion in 'Physics' started by leschge, May 28, 2022.

  1. leschge

    leschge

    Joined:
    Sep 21, 2019
    Posts:
    3
    Hello,
    I am trying to make a rocket bullet that uses a Rigidbody to move and a simple Collider. Now I actually only want to detect a collision with for example a cube via code. The collision detection works. But the rocket is also moving the cube because it touches it. So is it possible to not interact with it "physically" but only for collision detection in code?

    The rocket itself should use physics (as I want it to be deflected with a forcefield for example) so removing the Rigidbody is not an option. Also the Cube should use physics.
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    Rigidbody and Colliders ARE physics so I'm not sure what you mean by "use physics".

    If you don't want a collision response then set the collider to be a trigger.
     
  3. leschge

    leschge

    Joined:
    Sep 21, 2019
    Posts:
    3
    Thanks for the reply. Yes I am aware that Rigidbody and Colliders are physics. What I mean is that the rocket shoud not be able to apply a force to the cube. The collider from the rocket is already set to "Is Trigger"


    EDIT:

    I just realized that my rocket had a child that had another collider. After removing that it worked..
     
    Last edited: May 28, 2022
    MelvMay likes this.