Using Real Assets for AR Objects in Unity

Paul Killman
Antaeus AR
Published in
4 min readMar 3, 2024

In previous articles, I described how to place primitive objects using AR into the real world. In this article, I will use an asset from FileBase and place it into a scene. I chose the race car shown below.

Just for the practice, I decided to build this AR object from scratch. I first created an empty game object and named it Placement Prefab Car. I made sure that the position, rotation and scale were reset to 0.

Next, I placed the race car object as a child of the prefab. I immediately saw a couple of problems. First, my car was solid magenta and second, it was VERY large.

The magenta color was caused by the fact that the race car materials were not made for URP. I selected the three materials associated with the race car. As you can see from the pictures below, they are showing up as magenta.

With the three materials still selected I went to Edit -> Rendering -> Materials -> Convert Selected Built-In Materials to URP.

Unity warned me to make sure I had a backup of the materials, just in case.

I clicked on Proceed and after a brief time, my car now has the proper materials showing.

My next problem is the size of the car. This model was built to scale and will completely fill the screen of my mobile device. I scaled it down to 10% as a starting figure. I may have to change it after trying it out.

I added a cylinder as a child to the race car object. I will be using this to show that the car has been selected. I scaled the cylinder to act as a base to the car and added a red material to it. After I was happy with the size and placement of the cylinder, I turned it off. It will be controlled by the AR Selection Interactable component which I will add shortly.

I added the AR components to Placement Prefab Car to make this work.

With the objects I created before, I added an Annotation component. I decided that everyone could probably figure out that this was a car and that it didn’t need a label.

After I added the components above, I realized that my race car didn’t have a collider attached to it. I added a box collider.

Below, I will show the settings I used on each of the AR components that I added.

Selection
Translation
Scale
Rotation

I made a prefab out of this object and then added it to the AR Placement Interactable. I removed the object from the active scene.

Time to test it out. I built the project and installed it on my mobile device.

Even at 10% of its normal size, it’s still kind of large. I was able to scale, rotate and translate it though.

--

--