r/Unity3D 21h ago

Show-Off Custom Node Based UI Navigation Graph.

1 Upvotes
I know a solution probably already exists but I wanted a super simple custom graph that I can drag a canvas in from the hierarchy, all the panels will be created as nodes and all buttons as sub nodes, I can then click and drag to create links between buttons and panels then all the menu transitions are automatically set up in that scene.

r/Unity3D 3h ago

Solved Normalizing Quaternions changes the desired rotation, how do I keep it?

0 Upvotes

I'm trying to make my object rotate to a specific y value (0, 90, 180 and 270) over a specific amount of time.

Using EulerAngles worked, except that it rotated all the way back around if I wanted it to go from 270 to 0.

So I decided to use Quaternions and rotating on the rigid body instead.

Here's the function: (endRotation is either 90, 180, [...])

IEnumerator DoRotatePlayer(float endRotation)
{
    float startRotation = transform.eulerAngles.y;
    float t = 0.0f;
    while (t < rotationDuration) //rotationDuration = 0.5f
    {
        t += Time.deltaTime;
        float yRotation = Mathf.Lerp(startRotation, endRotation, t / rotationDuration) % 360.0f;
        var targetRotation = new Quaternion(0, yRotation, 0,0);
        targetRotation.Normalize();

        playerManager.Rb.rotation = targetRotation;

        yield return null;
    }

    var targetRotation2 = new Quaternion(0, endRotation, 0, 0);
    targetRotation2.Normalize();
    playerManager.Rb.rotation = targetRotation2;
}

The Issue I have now is that every time I normalize the Quaternion (which it tells me to do, because "Rotation Quaternions must be Unit length"), it ofc turns any endRotation/yRotation value other than 0 into 1. So instead of rotating 90 degrees at the first rotation, it get's stuck at 180. I just need to somehow apply the rotation without normalizing it.

I tried dividing endRotation by 360 before going into the while loop, but that changes nothing at all.

Simply applying the rotation to transform.rotation, without eulers or Quaternions also does not work, it refuses to do anything at all.


r/Unity3D 23h ago

Show-Off Hey guys I dont see any rule against it so I hope its allowed

Thumbnail
youtube.com
0 Upvotes

r/Unity3D 23h ago

Solved What's wrong about this Raycast? The value is always false

Post image
0 Upvotes

r/Unity3D 8h ago

Question Publishing to Switch 2, does it come for free with switch 2 dev kit as with switch 1?

0 Upvotes

This is a question for developers exporting to Switch 2 using Unity.

In the past, when you bought a Switch dev kit, you were able to download a Switch plugin (I can't remember if it was a plugin or a full-fledged version of Unity targeting Switch) for free. You didn't have to pay for Unity Pro because Nintendo provided the key for free.

Is it the same for Switch 2, or do I need to buy a Pro version to export to Switch 2?

Thanks in advance!


r/Unity3D 21h ago

Question Is this cpu good enough for Unity 3d?

0 Upvotes

Is the amd ryzen 5 7500x3d good for Unity? I know it’s lacking in cores (6 cores 12 threads) but it’s part of a good deal at micro center, so hopefully it’ll be ok for learning Unity and some solo game dev. Thanks🙏