---
# System prepended metadata

title: AR_Foundation - Learning ressource

---

# AR_Foundation - Learning ressource

To check the version compatibility : 
https://github.com/Unity-Technologies/arfoundation-samples

Available features per platformes : 
https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.1/manual/index.html

Setup & Get started tutorial : 
https://learn.unity.com/tutorial/setting-up-ar-foundation#

# Step 1 : Create a new project
- open the unity hub
- Make sure you have unity 2020.3.x LTS installed ![](https://i.imgur.com/FofCL5A.png)
- Also make sure you have the android build module. Else, add it : ![](https://i.imgur.com/dFwB2DV.png)![](https://i.imgur.com/3oGv1IO.png)![](https://i.imgur.com/OVlbLIw.png)


- Click on project new button to create a new project in 2020.3.x version ![](https://i.imgur.com/PbgD1ZA.png)
- wait the templates loading ![](https://i.imgur.com/4O9DAMg.png)
- Download th AR template ![](https://i.imgur.com/bJpFq2M.png)
- Name your project, choose this location and click on Create button
- Wait while unity start
- Follow this instructions ![](https://i.imgur.com/0zWT7j0.png) 
- Check ARcore ![](https://i.imgur.com/yx6DyR1.png)
- Open the build settings File>BuildSettins and switch build platform to Android ![](https://i.imgur.com/ImXTtgj.png)
- Now your environment is ready

# Step 2 : Plane detection and object spawn
- Open the "SampleScene" in ExamplesAssets>Scenes ![](https://i.imgur.com/gXNC6N0.png)
- We will add the 3D object to spawn in the approriate script (AnchorCreator). This script will spawn an object when we touch phone screen.
So, Add the CubeObject prefab in Anchor Prefab propertie ![](https://i.imgur.com/pXWcY2M.png)
- And build and run on your phone.

# Step 3 : Image detection
- Download this image, it will be our AR marker
![](https://i.imgur.com/iknasyZ.jpg)
- import them in Unity (drag'n'drop in your asset folder)
- Create a Reference image library (Right click in project tab)
![](https://i.imgur.com/6lPnxMC.png)

- Add the image in the reference image library :
![](https://i.imgur.com/OYqc5WB.gif)

- On the game object "AR Session Origin" add the component "ARtrackedImageManager"
![](https://i.imgur.com/y8wFoe4.png)

- Put in, "Serialized library" your "Reference Image Library"
- Create a prefab, like a simple sphere and put it in "Tracked Image Prefab". This object will be appear on the AR marker.
![](https://i.imgur.com/hfUoFoa.png)
- Make sure, your prefab location is 0,0,0
![](https://i.imgur.com/XXpHiI5.png)


- Build and run your app on your phone and test.






#### A Unity Project with this examples :  https://github.com/MartinCailleau/Unity_AR_Foundation_Start
