0
\$\begingroup\$

I am working on an augmented reality project in Unity using MRTK and have just found out that one Unity Unit is equal to a meter in real life. Unfortunately my project needs to be in yards. My current plan is to add an empty GameObject at the origin that scales everything about it by 0.9144 (the conversion factor between meters and yards) on start.

My question is if there is an easier way to do that? The only thing I could find about modifying Unity's standard scale is on their page on Preparing Assets for Unity

\$\endgroup\$
5
  • \$\begingroup\$ A lot of augmented reality projects use only rotational information, not translation, so unit scale doesn't enter into it. Others get translation from GPS, markers, IMU/MARG or other headset tracking, which might each have different ways to remap them to yards — that's why we need more specifics than just "augmented reality". Can you walk us through a minimal test case of something your app does that leads to a visible meter-yard mismatch? Once we have that test case, we can use it to target answers that accurately address the root of that issue. \$\endgroup\$ Commented Aug 7, 2023 at 14:20
  • \$\begingroup\$ @DMGregory This project uses MRTK and is for the HoloLens 2. This is for learning drill (where to move around) for marching band. My marching band plays on a football field which has lines based on yards so our drill is in yards. There is a cylinder that moves to a new position in Unity Units (which equates to meters) every some amount of seconds. The player is then supposed to walk to that cylinder. If the cylinder is moving to positions measured in meters rather than yards, the player will not be going to the correct position which is not good for learning drill. \$\endgroup\$ Commented Aug 7, 2023 at 14:37
  • \$\begingroup\$ Right, so you can just modify your script that moves the cylinder to scale its destination positions by the yard-to-meter conversion factor, right? We can help you with that if you show the code. It's also possible MRTK has a setting to change the units it uses for positioning the viewpoint based on its tracking data, if you want to attack this from the camera side. \$\endgroup\$ Commented Aug 7, 2023 at 15:28
  • \$\begingroup\$ @DMGregory Thanks for the help. It was not very difficult to modify my code. I was just wondering if MRTK had a setting that I was not able to find. \$\endgroup\$ Commented Aug 8, 2023 at 1:00
  • 2
    \$\begingroup\$ I've been digging trying to find one, but it looks like the Windows Spatial Perception framework MRTK is built on works exclusively with metric coordinate systems: "The units for these coordinates will always be in meters." So even if Unity's units are open to reinterpretation, MRTK will only ever position its objects in meters. I think your best bet is to post your solution as an Answer below. \$\endgroup\$ Commented Aug 8, 2023 at 1:53

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.