Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Stretch to end" for CreateGameObjects
#10
(06-05-2022, 05:04 PM)_Aka_ Wrote: Let me know if this fixed your issue.
Have a nice day

Yes it did, although it needed a small modification. The rotation can produce a vector with negative components, which leads to bad behavior. Using the absolute values worked:

Code:
                Vector3 vec = Quaternion.Euler(Rotate) * new Vector3(
                                    rotationlessBoundsSize.x * Scale.x,
                                    rotationlessBoundsSize.y * Scale.y,
                                    rotationlessBoundsSize.z * Scale.z);
                vec.x = Mathf.Abs(vec.x);
                vec.y = Mathf.Abs(vec.y);
                vec.z = Mathf.Abs(vec.z);
                bounds.size = vec;

Thanks for the help.
Reply


Messages In This Thread
RE: "Stretch to end" for CreateGameObjects - by Anubis132 - 06-05-2022, 08:34 PM

Forum Jump: