Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Our response to Improbable’s blog post (and why you can keep working on your SpatialOS game). Read more here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Fast moving collider = pushing objects through floor

Discussion in 'Physics' started by joshcamas, Jan 10, 2019 at 5:54 PM.

  1. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    373
    I'm building a large monster that attacks their victims by smashing their body onto them.

    However, unsurprisingly, since it's body is a collider, it causes whatever object underneath them to be pushed through the ground. (since the attack is so fast)

    Sadly I do indeed need collision on the monster :(

    Any ideas? I'm hoping to not need to sacrifice the game play for physics issues if possible
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,031
    I assume you've already tried setting the Collision Detection Mode to "Continuous Dynamic". If not, that's an easy place to start to see if the performance is improved.

    Is your attack occurring via an animation? If so, is the monster's Animator's Update Mode set to "Update Physics"?

    One approach might be to turn the collider into a trigger collider during the attack. Then, instead of applying force via the collider, you'd check for Trigger Enter on the trigger, and do something interesting (like kill the player, push an object away, etc).

    I guess another important question is: What should happen when your monster squashes something? Should something different happen depending on what gets squashed?
     
    joshcamas likes this.