AR game mechanics implementation in mobile app

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
AR game mechanics implementation in mobile app
Complex
~1-2 weeks
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing AR Game Mechanics in Mobile Applications

AR games aren't just 3D objects on screen. This is physics, interaction with real world, managing scene lifecycle and working when user moves, covers camera with hand, ARKit loses tracking at worst time.

Any mechanic looking simple in 2D or 3D games, in AR requires rethinking.

Physics in AR: RealityKit vs SceneKit vs Custom

RealityKit — first choice for new projects. PhysicsBodyComponent + CollisionComponent give native physics via ARKit's scene understanding:

var physicsBody = PhysicsBodyComponent(massProperties: .default, material: nil, mode: .dynamic)
physicsBody.isAffectedByGravity = true
entity.components[PhysicsBodyComponent.self] = physicsBody

var collision = CollisionComponent(shapes: [.generateBox(size: entity.visualBounds(relativeTo: nil).extents)])
entity.components[CollisionComponent.self] = collision

With enabled arView.environment.sceneUnderstanding.options = [.physics] AR objects correctly interact with real surfaces. Ball rolls on real table, box stands on real shelf.

RealityKit problem — limited control. No access to individual physics engine steps, no custom force generators. For simple mechanics — sufficient. For complex game physics (ragdoll, fluid simulation, rope physics) — need SceneKit + PhysicsWorld or Unity with AR Foundation.

Control in AR: Gestures vs Controller

Tap to place, pinch to scale, rotation — standard. But in AR gestures compete with camera movement. User wants to rotate object — ARKit interprets as hand tracking.

Solution via UIGestureRecognizer with shouldRequireFailure(of:): tap recognized only if swipe doesn't start. For rotation — UIPanGestureRecognizer with minimum displacement 20 points before activation, so accidental camera movement doesn't trigger rotation.

Separate mechanic — "aiming" via screen center instead tap. More convenient in shooters and strategies: raycast from arView.center each frame, object under crosshair highlights, action — button. Implemented via ARView.raycast(from:allowing:alignment:) in CADisplayLink callback.

Most Frequent AR Game Mechanic Problems

Tracking loss during gameplay. ARKit transitions to .limited tracking state — objects "float". For AR games this disaster: enemy teleports 30 cm, ball passes through wall. Strategy: on .limited "freeze" physics, show overlay "Point camera at surface", resume after .normal. Don't interrupt game loop — just pause physics.

AR objects outside viewport. Player turns, AR enemy behind back continues moving and attacking. Need frustum culling not for rendering (ARKit does this), but game logic: AI of enemies outside viewport can work simplified or pause.

Spawning on uneven surfaces. Raycast returns surface normal via ARRaycastResult.worldTransform — fourth column is point, X/Y/Z — orientation. If surface tilted 30°, spawned object tilts with it. For games with "flat" objects (tokens, chips) fix vertical: take only Y from normal, build transform with up = (0,1,0).

Case from Practice

Mobile AR strategy: towers, enemies, real table as map. 6 unit types, pathfinding on mesh surface. Main problem: ARMeshAnchor updates asynchronously — while mesh rebuilds, pathfinding graph stale. Solution: navigation graph updated every 3 seconds on background thread via GCD, units used cached graph. Unit during movement checked collision with current mesh via raycast — caught situations "mesh changed, unit walks through wall".

FPS kept at 60 on iPhone 13. On iPhone 11 dropped to 45 with 6+ units. Solution: LOD for distant units (simplified meshes), shadow disable beyond 0.5 meters.

What's Included

  • AR object physics with real surface interaction (RealityKit / SceneKit)
  • Control system: gestures, aiming, UI buttons
  • Game loop with ARKit tracking loss handling
  • AI and pathfinding on AR surfaces
  • LOD optimization for supporting iPhone 11 and up
  • Testing in real lighting conditions

Timeline

Mechanic Timeline
Simple AR mini-games (tap, shoot) 2–4 weeks
Strategy / tower defense with AI 8–14 weeks
Full AR shooter with network game 16–24 weeks

Cost calculated after detailed mechanics discussion.