Onyebuchi
Onyebuchi

Reputation: 3

Place On Plane Script In Unity

I just started learning AR development with unity using this YouTube tutorial (https://www.youtube.com/watch?v=lelX8GGh_S8). At some point in the tutorial, the creator added a script called "Place on Plane" to the AR Session Origin. He didn't write the script in the tutorial and it seems more like a Unity script but for some reason, I wasn't able to find it in my Unity and now I'm stuck. Please, any assistance would be greatly appreciated.

Script: https://github.com/Unity-Technologies/arfoundation-samples/blob/main/Assets/Scripts/PlaceOnPlane.cs

Upvotes: 0

Views: 1370

Answers (2)

In order to add "Place On Plane" script follow the steps below:

  1. In the Inspector Panel (Right Hand Side) with AR Session Origin selected add a blank script
  2. Name the script as "PlaceOnPlane" and open it in Visual Studio Code
  3. Copy and Paste the code from the link below in Script using VS Code Editor https://github.com/allinreality/PlaneTracking-ARFoundationUnity3D/blob/main/RequiredAssets/PlaceOnPlane.cs
  4. Save the script and it will update the Component in Inspector Panel that will allow you to add Visual and Prefab

Hope this helps - Thank you

Upvotes: 0

derHugo
derHugo

Reputation: 90724

If you look into the PackageManager for ARFoundation

enter image description here

you find

Samples available at https://github.com/Unity-Technologies/arfoundation-samples

which basically means: These are not included! If you want to use anything from there then download and import these samples into your project.

Upvotes: 2

Related Questions