Hi there,
I'm using Advanced Collision to make a fighting game. I've managed to compare two rects to check for collision using this code:
float originX = (currentSprite.FlipX) ? -currentSprite.CurrentSprite.customColliders[i].origin.x : currentSprite.CurrentSprite.customColliders[i].origin.x;
Rect collisionRect = new Rect(
(gameObject.transform.localPosition.x+originX)-currentSprite.CurrentSprite.customColliders[i].Size.x/2,
(gameObject.transform.localPosition.y+currentSprite.CurrentSprite.customColliders[i].origin.y)-currentSprite.CurrentSprite.customColliders[i].Size.y/2,
currentSprite.CurrentSprite.customColliders[i].Size.x,
currentSprite.CurrentSprite.customColliders[i].Size.y);
But now i'm facing another problem, i got a sprite with a 45 degree angle, like this:
But when I run that code into this kind of image, this happen:
I coudn't find a way to rotate a Rect, how can i do that?
Thanks!