How to change the orientation for an overlapbox?
Hi there, after a good amount of searching I haven't been able to find out how to change the rotation of my overlap boxes set up.
//draw a hitbox in front of the character to see which objects it collides with
Vector3 boxPosition = transform.position + (Vector3.up * lastAttack.collHeight) + Vector3.right * lastAttack.collDistance;
Vector3 boxSize = new Vector3 (lastAttack.CollSize/2, lastAttack.CollSize/2, hitZRange/2);
Collider[] hitColliders = Physics.OverlapBox(boxPosition, boxSize, transform.rotation, HitLayerMask);
I'm using it for damage calculation. I want the OverlapBox to take the same rotation of the player and always be in front of the player.
Have you figured this out ? I'm trying to achieve the exact same thing but can't seem to figure it out. I tried changing the angle attribute but it does nothing.,Hey have you possibly figured this out? I need to do the exact same thing for a 2D topdown RPG. I have tried changing the angle attribute but to no avail.
Yes they answer me on stackoverflow https://stackoverflow.com/questions/57982000/how-to-change-the-orientation-for-an-overlapbox-and-a-gizmo
Answer by MorrowporoSpm · Apr 29 at 03:54 PM
Hello, did you find any solution for this? Or did you use box collider or mesh collider instead?
Your answer
Follow this Question
Related Questions
Runtime Rotation Gizmos Not Working on The X Axis 0 Answers
What is the proper orientation for an overlapbox? 1 Answer
Unity Overlap Point Causing Error 0 Answers
Rotate camera on collision of character 1 Answer
Space/Aircraft rotation 0 Answers