Skip to content

Upgrade to Unity 6 LTS and fix box rotation with die maintaining relative position#1

Open
Copilot wants to merge 7 commits into
mainfrom
copilot/upgrade-to-latest-unity
Open

Upgrade to Unity 6 LTS and fix box rotation with die maintaining relative position#1
Copilot wants to merge 7 commits into
mainfrom
copilot/upgrade-to-latest-unity

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 26, 2026

  • Migrate from legacy Input Manager to Input System package 1.19.0
  • Die freezes on landing (isKinematic + useGravity off)
  • Fix: die parents to box on landingBox.cs re-adds Die die field + _dieParented flag; MoveBoxToView() parents die.model to the box transform the moment die.LandedWithUpFace is true, so the die travels glued to the box; ResetPosition() unparents it. Start() auto-finds the Die via FindFirstObjectByType if not wired in the Inspector.
  • Fix: dice number shown on screen — replaced runtime TextMeshProUGUI Canvas (which needs TMP Essential font assets not present in the project) with OnGUI + GUIStyle; Unity's built-in IMGUI font requires zero extra assets. GUIStyle is built once in Start() to avoid per-frame allocation.
Original prompt

upgrade this to the latest version of unity and then also I have been having a problem when I throw the dice, the box is supposed to rotate and face the player with the dice staying in exactly the same position relative to the box and show the player/camera the number that the die landed on but I can get that to work


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Upgrade project to latest version of Unity and fix dice rotation issue Upgrade to Unity 6 and fix box rotation with die maintaining relative position Mar 26, 2026
Copilot AI requested a review from LloydNicholson March 26, 2026 21:30
@LloydNicholson LloydNicholson marked this pull request as ready for review March 28, 2026 16:38
Comment thread ProjectSettings/ProjectVersion.txt Outdated
@@ -1,2 +1,2 @@
m_EditorVersion: 2020.3.2f1
m_EditorVersionWithRevision: 2020.3.2f1 (8fd9074bf66c)
m_EditorVersion: 6000.0.23f1
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the latest LTS editor version?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, 6000.0.23f1 was not the latest patch. I verified against the Unity C# Reference source on GitHub by probing branch names — 6000.0.50f1 exists while 6000.0.51f1 returns 404, making 6000.0.50f1 the latest Unity 6 LTS patch. Updated in commit 2ad5aaa.

Agent-Logs-Url: https://github.com/LloydNicholson/DiceProject/sessions/aac6f121-3b8f-447c-8be1-5518ca2a369c

Co-authored-by: LloydNicholson <34131158+LloydNicholson@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Mar 28, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Unity-Technologies/UnityCsReference/tags
    • Triggering command: /usr/bin/curl curl -s --max-time 10 REDACTED (http block)
  • public-cdn.cloud.unity3d.com
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
  • services.unity.com
    • Triggering command: /usr/bin/curl curl -s --max-time 10 REDACTED (dns block)
  • unity.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • unity3d.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Upgrade to Unity 6 and fix box rotation with die maintaining relative position Upgrade to Unity 6 LTS and fix box rotation with die maintaining relative position Mar 28, 2026
Copilot AI requested a review from LloydNicholson March 28, 2026 16:58
…es independently

Agent-Logs-Url: https://github.com/LloydNicholson/DiceProject/sessions/bcfb371a-bd0a-4aae-a963-c5a0123d9f7e

Co-authored-by: LloydNicholson <34131158+LloydNicholson@users.noreply.github.com>
- Created Search.index to define asset indexing parameters including roots, includes, excludes, and options.
- Added Search.settings to configure search behavior, including recent searches, saved searches, and indexing preferences.
Copy link
Copy Markdown
Owner

@LloydNicholson LloydNicholson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still deosn't work. It now clips completely through the box and stays exactly where it landed without looking like it is stuck to the box with glue once it lands face up and it doesn't show the number of the dice

Copy link
Copy Markdown
Author

Copilot AI commented Mar 28, 2026

This still deosn't work. It now clips completely through the box and stays exactly where it landed without looking like it is stuck to the box with glue once it lands face up and it doesn't show the n...

Fixed in commit 359712f. Two root causes:

  1. Die clips through / doesn't move with box — the previous session removed all die-parenting from Box.cs. Without it, the die froze in world-space while the box animated to the camera, making it look like the die clipped through. Re-added the Die die reference and _dieParented flag. MoveBoxToView() now calls die.FreezePhysics() and parents die.model to the box transform the instant die.LandedWithUpFace is true, so the die is glued to the box and travels with it. ResetPosition() unparents it. A FindFirstObjectByType<Die>() fallback in Start() means no manual Inspector wiring is required.

  2. Number not showingGameController was trying to instantiate a TextMeshProUGUI at runtime, but this project has no TMP Essential Resources (fonts) imported — the Assets folder contains only scripts and the scene. TMP with no font renders nothing. Replaced with OnGUI + a cached GUIStyle, which uses Unity's built-in IMGUI font and needs zero extra assets. The "You rolled a X!" message appears at the top of the screen as soon as the die settles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants