I've adapted Zone Manager (for my own uses) to have a better creation tool for rectangular zones. However, my main problem is the rotation of those zones not aligning and not rotating as I would expect. I am posting this here because it's more of a general issue with rotating gameObjects, and I don't feel it's specifically related to zones.
GOAL:
Have rectangular zones that are perfectly aligned with square foundation orientation so they can be used in rectangular structures.
PROBLEM:
Because I don't necessarily know where which direction the zone needs to orientate, I get the foundation transform.rotation when the user creates the zone. I then apply that rotation to the zone.
However, it doesn't rotate it in place as I would expect. Instead it seems to rotate it around the origin of the map (red).
- ZoneManager succesfully rotates the rectangular zone with this /zone rotation flag command:
zone.definition.Rotation = Quaternion.AngleAxis(rotation, Vector3.up).eulerAngles;- Rotating with respect to Space.World
- Honestly so many other things I can't think of.
I've tried for the past 2 days and have even had someone else look at it and they tried for several hours with no success. Quaternions and 3D space is not my strong suit, so I'm shooting in the dark pretty much. I would appreciate and honestly pay for any help at this point.
KEY:
red circle = ~world origin
green wireframe = un-rotated zone with working trigger for the highlighted zone
walls next to green = intended zone area/rotation
yellow square = rotated zone with working trigger around that rough area
