Skip to content

mmints/ar-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AR Game

Unity, ARToolkit, Android Deployment

  1. Download newest Unity, JDK, Android SDK, ARToolkit5 Tools, ARToolkit5 for Unity
  2. Open Project (/ ARToolkit sample scene "Standard Asset Example Project" / "CubemarkerScene")
  3. Open Unity, import ARToolkit Tools, ARToolkit Package
    • Assets->Import Package, only select those 3 Folders! screenshot1
  4. Switch Project Type to Android (File->Build Settings)
  5. Unity Edit->Preferences->External Tools set JDK Path and Android SDK Path
  6. Print example marker
  7. Build Settings -> Build (Export to game.apk)
  8. Install using Unity, Android Debug Bridge('adb install -r game.apk') or copy manually
  9. Change AR params if needed (Unity SceneGraph->ARToolKit->Inspektor, Threshold und Cutoff)
Troubleshooting
  • "unable to list target platforms": Apply Android SDK patch tools_r25.2.3-windows.zip. [Help]
  • "Plugins colliding error": delete libARWrapper.so and libc++_shared.so in PROJECT_DIR\Assets\Plugins\Android
Notes
  • According to docs, an older Unity version is compatible with ARToolkit. This is not true, new Versions are also supported
  • Known issue: Autofocus / camera resolution fix. Solution available but worse tracking?
    • dest: PROJECT_DIR\Assets\Plugins\Android\UnityARPlayer.jar
      • default Unity project path: C:\Users\Public\Documents\Unity\Projects
    • Replace this file (or move to entirely else Folder) with this
    • (Source) To solve these issues, we may want to follow the issue trackers/forum

Tips & Tricks

  • Change Object Material: Mesh Renderer -> Material -> Element 0 -> Click small far right circle
  • Asset Store allows searching for free Assets (Textures, Shaders)
  • Invisible boxes by disabling Mesh Renderer
  • Object Layer should be "AR Background 2"
  • Physically interacting Objects need "RigidBody" component
  • "Marker Scene" contains "AR Tracked Object" component, set "stay visible" in seconds (f.i. 0.05)
  • Tilt-Device-Physics requires Accelerometer C# Code Snippet
    • Script File and Class name must match

Game Object Setup

Flipper
  • Hinge Joint
    • Spring: 5000
    • Damper: 15
    • Limit Min: 0 (left), -45 (right)
    • Limit Max: 45 (left), 0 (right)
  • Flipper Controller
    • Input Button: left or right button from canvas (Canvas has to be part of the scene!)
    • Rest Position: 0 (L & R)
    • -45 (left), 45 (right)
    • Input Name: name of the input source witch is setted in the project preferences

References

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •