playMaker

Author Topic: Unity-ARKit-Plugin  (Read 1160 times)

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 296
    • View Profile
Re: Unity-ARKit-Plugin
« Reply #15 on: September 25, 2017, 08:57:20 AM »
That sounds nice.  I have a small interactive project here that uses playmaker entirely, but purely via interacting with the ARKit components directly on top of their ARKit example scene.  I haven't written any actions for my work. 

Whatever happened to @tcmeric? 


Groo Gadgets

  • Junior Playmaker
  • **
  • Posts: 95
    • View Profile
Re: Unity-ARKit-Plugin
« Reply #16 on: September 28, 2017, 07:18:22 PM »
Heya,

Really looking forward to these actions. I mainly want a solution to turn on and off AR functionality in my game since I don't want to create an "always on" AR experience.

I've done some experiments but can't seem to get it to work properly, the button I have made to switch between my game cam and AR cam doesn't block the raycast when I touch the button so when I tap the button the AR object moves.

Has anyone got any tips or a link to some docs on AR?

Cheers,

Simon

tcmeric

  • Sr. Member
  • ****
  • Posts: 479
    • View Profile
Re: Unity-ARKit-Plugin
« Reply #17 on: September 28, 2017, 08:55:03 PM »
Hi. I am still alive  ;D

This is still on my to do list. Ill update more information here as I have it.

Padenlee

  • Playmaker Newbie
  • *
  • Posts: 23
  • You can't hit what you don't shoot for!
    • View Profile
    • Personal Site
Re: Unity-ARKit-Plugin
« Reply #18 on: October 02, 2017, 01:01:26 PM »
Thanks for making this happen! I'm also looking forward to these actions.
« Last Edit: October 02, 2017, 01:12:20 PM by Padenlee »
-Paden Pierry
@padenpierry

dt1000

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: Unity-ARKit-Plugin
« Reply #19 on: October 11, 2017, 09:21:24 AM »
Hi there.
Apologies for the radio silence - things have been a bit busy here at Thunderbox HQ.

So... I finished adding AR to our game using PlayMaker. Here is a short (and shaky) video)...

https://youtu.be/CGewGIBlPpo

You can grab Tsuro from the App Store here...

https://itunes.apple.com/app/tsuro/id957124541?mt=8

I did end up creating a few ARKit actions... but the way that the Unity plug-in works requires a lot of components to be added to things. Creating a PlayMaker only solution for this is not a trivial task and I just don't have the time to do it.

In the interests of sharing, you can grab the actions I made at the link below, but they need  a little set-up to get them working:

https://drive.google.com/open?id=0BxYKc0FnzFsFQ01tam5fWi11VEU

I would recommend placing the camera tracking scripts from Unity's demo scenes on your camera, maybe adding surface managers and point cloud managers as well (to help visualize) and then noodling around with the actions...

Detect AR Capability - Checks to see if you are on iOS11 with an A9 chip (or greater). Use this to show your AR UI only when appropriate.

Start AR Session - Use this to initiate the AR session before activating the camera with the AR script on (the camera script does it automatically, so you may not actually need this... I just preferred having more control).

Detect Hit - this will let your FSM know if there is a surface at the centre of the screen, so you can place an object at the hit location. Could easily be tweaked to detect a surface hit at a specific screen point, to work with a touch-based action.

Set Reticle Text - this is a bit specific to my project... it sets text based on the type of hit just detected. It will probably need tweaking to suit your needs.

Pause AR Session - you can never stop an AR session. Use this when you are done with AR to save that battery juice! Also gives you the option to totally reset the AR tracking.

Apologies I couldn't provide a more robust solution, but hopefully this will get things rolling!

Cheers,
Dan

Groo Gadgets

  • Junior Playmaker
  • **
  • Posts: 95
    • View Profile
Re: Unity-ARKit-Plugin
« Reply #20 on: October 12, 2017, 12:14:12 AM »
Hey Dan,

Thank you so much for sharing these actions! JUst had a look for your game on the App Store, it's featured at #1 in the AR section of the Australian App Store! Well done! I will purchase it later tonight and have a good play  :-)

dt1000

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: Unity-ARKit-Plugin
« Reply #21 on: October 12, 2017, 04:54:31 AM »
Nice! We spoke to Apple regarding a potential feature... but they can never guarantee anything (which is fair enough, as there are a lot of cool apps out there).

Adding AR didn't take us too long, and has definitely given us a nice bump in sales.

Hopefully you guys will all be able to get going with minimal fuss - good luck! :D

q21turner

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Unity-ARKit-Plugin
« Reply #22 on: October 17, 2017, 04:51:00 AM »
This is amazing thank you so very much!

Groo Gadgets

  • Junior Playmaker
  • **
  • Posts: 95
    • View Profile
Re: Unity-ARKit-Plugin
« Reply #23 on: October 28, 2017, 12:22:47 AM »
Hey Dan,

I finally had a chance to download and try out your actions. I can't get them to work :(

So I have a project with the ARKit package from Unity and PlayMaker only. I load up the UnityARKitScene.unity and create an empty object for the FSM to exist on.

I'm trying to use the Detect Hit action, I set the AR Camera and the reticle with a cube object. I've also setup the hit bool to return true when a surface is hit.

Nothing seems to happen, the bool never registers as true. This is the case in both the remote app and when I build the app to my iPad Pro.

Any help would be great!

Cheers,

Simon

dt1000

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: Unity-ARKit-Plugin
« Reply #24 on: October 29, 2017, 05:25:08 AM »
The will detect planes and other AR surfaces generated by the plugin. If your area is dimly lit or not clear and flat, you won't get a hit. Test it with another AR app first, to be sure. I couldn't actually test Tsuro in my office because it is too dingy!!! :(

Can you post a screengrab of your set up and FSM with the Hit Detection action visible? I can double check you have it set up right.