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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Rotated rectangle collision

Discussion in 'Made With Unity' started by ITAmember, Jun 18, 2010.

  1. ITAmember

    ITAmember

    Joined:
    Feb 13, 2010
    Posts:
    88
    I needed to do some collision between arbitrarily rotated rectangles in my projects so I translated the code from this page to Unity C#.

    It's fairly simple to use, just create a RotatedRect object and use the appropriate methods to do what you want. (the important method would of course be Intersects)

    Like I said it is in C#, if you want it in JavaScript then you will have to translate it yourself.
     

    Attached Files:

  2. hugettini

    hugettini

    Joined:
    Apr 1, 2013
    Posts:
    19
    Works like charm

    Thank you! ;)