GAME DEV · SEP 2026
AR Block Shooter
Mobile AR prototype: scan the floor, tap to place a block structure, then tap to fire balls from the phone camera and topple every block before the ammo runs out.

At a glance
- ROLE
- Solo developer
- TEAM
- Solo
What I built
- AR Foundation plane detection with tap-to-place for the block structure.
- Up to 8 balls fired from the phone camera, with a slight upward launch angle so they arc onto the target.
- Event-driven game loop: ammo, block and game-over events drive the UI, so the gameplay code holds no UI references.
- Knock detection against each block's settled pose, recorded 0.5 s after spawn.
- Play-testing and bug fixes, such as pedestal blocks being counted as targets.
- An About card with a link to the website.
Technical decision
A block is knocked when it leaves where it settled
A block counts as knocked when it tilts more than 40 degrees or moves more than 0.15 m from where it settled. That rest pose is recorded half a second after spawn, so the physics that settles the stack on the floor is not counted as a hit. Comparing against the rest pose, instead of listening for collisions, also means a block that is only nudged by its neighbours stays standing. The block raises one event and the shooter does the counting, so the block knows nothing about the game.
KnockableBlock.cs
using UnityEngine;
public class KnockableBlock : MonoBehaviour
{
[SerializeField] private float settleDelay = 0.5f;
[SerializeField] private float toppleAngle = 40f;
[SerializeField] private float displacementThreshold = 0.15f;
public event System.Action OnKnocked;
private Vector3 restPosition;
private bool isSettled;
private bool isKnocked;
private void Start()
{
Invoke(nameof(RecordRestState), settleDelay);
}
private void RecordRestState()
{
restPosition = transform.position;
isSettled = true;
}
private void FixedUpdate()
{
if (!isSettled || isKnocked) return;
float tilt = Vector3.Angle(transform.up, Vector3.up);
float displacement = Vector3.Distance(transform.position, restPosition);
if (tilt > toppleAngle || displacement > displacementThreshold)
{
Knock();
}
}
public void Knock()
{
if (isKnocked) return;
isKnocked = true;
OnKnocked?.Invoke();
}
}