Sitemap
Press enter or click to view image in full size

Simple Pickup Mechanics

2 min readAug 4, 2025

--

This next series of articles will cover how the player interacts with their environment. Let’s get started with a super simple pickup mechanic that is great for prototyping. I will be using Unity 2022 HDRP for the following articles. Enjoy!

A popular behavior with pickups is to have them disappear once collected. Let’s start with this sci-fi box and let the player interact with it. I am using the default Unity 3rd person player controller that comes with the standard assets package.

Press enter or click to view image in full size

The loot box has a Box Collider with isTrigger set to true, and the Pickup script I will be using. There is also a Particle System that will appear when the collider is triggered.

The script on the box is very simple. The OnTriggerEnter method checks for the Player tag, instantiates the particle system and then destroys itself. This is where you can get a reference to the player script and grant some status upgrades. Pickups like health and ammo, etc. are a great use for these simple pickup behaviors.

using UnityEngine;

public class Pickup : MonoBehaviour
{
[SerializeField] private GameObject _particleFX;

private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
if (_particleFX != null)
Instantiate(_particleFX, transform.position, Quaternion.identity);

Destroy(gameObject);
}
}
}

Here is the player collecting the box and the particle system playing.

Press enter or click to view image in full size

I hope you enjoyed this brief introduction to user interactions. Please joim me for my forthcoming articles and thanks for reading!

--

--

Jared Amlin
Jared Amlin

Written by Jared Amlin

I am an artist and musician, that is currently diving headfirst into game development with C# and Unity3D.

No responses yet