Does anyone know why using Scale is just... being weird?
Basically, I use two arrows to change the scale OR position of a target. It depends on what mode I'm currently in. The axis I use are X and Y.
I also use 1 ring on the Z axis to change the rotation of the target.
This is the scale function, which works correctly if I haven't changed the rotation of the target:
void EditScale(Ray camRay, float planeDist)
{
// Calculate the change in mouse position
Vector3 currentMousePosition = camRay.GetPoint(planeDist);
float delta = currentMousePosition.y - initial.y; // Use the y component for vertical movement
// Calculate the scale factor based on the mouse movement
float scaleFactor = 1f + delta * ScaleMultiplier; // You can adjust the multiplier based on your preference
// Apply the scale based on the axis
if (axis == Axis.X)
Thing.transform.localScale = new Vector3(initial.x * scaleFactor, Thing.transform.localScale.y, Thing.transform.localScale.z);
else if (axis == Axis.Y)
Thing.transform.localScale = new Vector3(Thing.transform.localScale.x, initial.y * scaleFactor, Thing.transform.localScale.z);
else if (axis == Axis.Z)
Thing.transform.localScale = new Vector3(Thing.transform.localScale.x, Thing.transform.localScale.y, initial.z * scaleFactor);
// Update the initial position for the next frame
initial = currentMousePosition;
}```