Introduction
Game development is a craft that blends creativity with technical precision. Whether you are building a 2D platformer in Unity, an open-world RPG in Unreal Engine, or a lightweight mobile game in Godot, the right prompts can accelerate your workflow. This article presents a curated collection of 30 structured prompts organized by engine and difficulty level — from basic code snippets to advanced optimization queries. Each prompt is designed to be immediately actionable, saving you hours of debugging and design iteration.
How to Use These Prompts
Each prompt follows the format: task → prompt → example result. The prompts are written in a conversational tone suitable for AI assistants like Claude, ChatGPT, or local models. Simply copy the prompt, replace the placeholders (e.g., [YourGameName]), and execute in your IDE or engine. The example results show typical output you can expect.
Basic Prompts (Unity C#)
1. Player Movement Script
Task: Create a basic 2D player movement script with WASD controls.
Prompt: "Write a C# script for Unity that moves a 2D player character using WASD keys. Include a public float speed variable and use Rigidbody2D for physics. Add a jump function with a public jumpForce variable and a ground check using a LayerMask."
Example Result:
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float speed = 5f;
public float jumpForce = 10f;
public LayerMask groundLayer;
private Rigidbody2D rb;
private bool isGrounded;
void Start() { rb = GetComponent<Rigidbody2D>(); }
void Update()
{
float move = Input.GetAxisRaw("Horizontal");
rb.velocity = new Vector2(move * speed, rb.velocity.y);
if (Input.GetButtonDown("Jump") && isGrounded)
{
rb.AddForce(Vector2.up * jumpForce, ForceMode2D.Impulse);
}
}
void OnCollisionStay2D(Collision2D collision)
{
isGrounded = (collision.gameObject.layer == LayerMask.NameToLayer("Ground"));
}
}
2. Health System
Task: Implement a simple health system with damage and healing.
Prompt: "Create a C# script for Unity that manages a player health integer (max 100). Include a public TakeDamage(int amount) method that reduces health and a Heal(int amount) method. Clamp health between 0 and max. Log a death message when health reaches 0."
Example Result:
using UnityEngine;
public class Health : MonoBehaviour
{
public int maxHealth = 100;
public int currentHealth;
void Start() { currentHealth = maxHealth; }
public void TakeDamage(int amount)
{
currentHealth -= amount;
currentHealth = Mathf.Clamp(currentHealth, 0, maxHealth);
if (currentHealth <= 0) Debug.Log("Player died");
}
public void Heal(int amount)
{
currentHealth += amount;
currentHealth = Mathf.Clamp(currentHealth, 0, maxHealth);
}
}
3. Spawner Object Pool
Task: Create an object pool for spawning bullets.
Prompt: "Write a Unity C# script for a generic ObjectPool class. It should have a Queue of GameObjects, a public method GetObject() that returns an inactive object from the pool (or instantiates a new one if empty), and a ReturnObject(GameObject obj) method that deactivates and enqueues it. Use a prefab reference."
Example Result:
using System.Collections.Generic;
using UnityEngine;
public class ObjectPool : MonoBehaviour
{
public GameObject prefab;
private Queue<GameObject> pool = new Queue<GameObject>();
public GameObject GetObject()
{
if (pool.Count > 0)
{
GameObject obj = pool.Dequeue();
obj.SetActive(true);
return obj;
}
return Instantiate(prefab);
}
public void ReturnObject(GameObject obj)
{
obj.SetActive(false);
pool.Enqueue(obj);
}
}
Intermediate Prompts (Unreal Engine Blueprints)
4. Door with Animation
Task: Create an interactive door that opens on player proximity using Blueprints.
Prompt: "In Unreal Engine 5, create a Blueprint Actor for a door. Add a Box Collision component as trigger. On Overlap Begin, play a timeline that interpolates the door's relative rotation from 0 to 90 degrees over 1 second. On Overlap End, reverse the timeline. Use a Timeline node with a float track."
Example Result:
1. Create new Blueprint class Actor, name it BP_Door.
2. Add a Cube mesh (Static Mesh) as root, and a Box Collision.
3. In Event Graph: OnComponentBeginOverlap → Play Timeline (0→90, 1s) → Set Relative Rotation (Yaw).
4. OnComponentEndOverlap → Play Timeline Reverse.
5. Inventory System (C++)
Task: Build a basic inventory with pickup and drop.
Prompt: "Write a C++ class in Unreal Engine for an inventory component. It should hold a TArray
Example Result:
// InventoryComponent.h
UCLASS(Blueprintable, ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class MYGAME_API UInventoryComponent : public UActorComponent
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TArray<UInventoryItem*> Items;
UFUNCTION(BlueprintCallable)
void AddItem(UInventoryItem* Item);
UFUNCTION(BlueprintCallable)
void RemoveItem(UInventoryItem* Item);
};
6. AI Patrol Behavior
Task: Create a simple AI that patrols between waypoints.
Prompt: "In Unreal Engine 5, create an AI controller Blueprint for an enemy. Use a Behavior Tree with a Selector and Sequence. The sequence should: (1) Find next waypoint from a predefined array of target points, (2) Move to waypoint using MoveTo node, (3) Wait 2 seconds. Loop indefinitely."
Example Result:
- Behavior Tree: Root → Selector → Sequence → FindWaypoint (Task) → MoveTo (Task) → Wait (Task).
- Blackboard keys: TargetLocation (Vector), WaypointIndex (Int).
- BTTask_FindNextWaypoint: increments index, sets TargetLocation from array.
Advanced Prompts (Godot 4 GDScript)
7. State Machine for Player
Task: Implement a finite state machine for player character states (idle, run, jump, fall).
Prompt: "Write a GDScript state machine for a Godot 4 CharacterBody2D. Create a State base class with enter(), exit(), update(delta) methods. Implement IdleState, RunState, JumpState, FallState. Use a StateMachine node that holds a dictionary of states and transitions based on input and velocity."
Example Result:
extends Node
class_name StateMachine
var states = {}
var current_state: State
func add_state(name: String, state: State):
states[name] = state
func change_state(new_state_name: String):
if current_state:
current_state.exit()
current_state = states[new_state_name]
current_state.enter()
func _process(delta):
if current_state:
current_state.update(delta)
8. Procedural Terrain Generation
Task: Generate a simple 2D terrain using Perlin noise.
Prompt: "Write a GDScript in Godot 4 that creates a TileMap procedurally. Use the FastNoiseLite resource with Perlin noise. For each cell in a 64x64 area, if noise value > 0.3 place a grass tile (source_id 0, atlas coords Vector2i(1,0)). Use set_cell() on a TileMap layer."
Example Result:
extends TileMap
func _ready():
var noise = FastNoiseLite.new()
noise.noise_type = FastNoiseLite.TYPE_PERLIN
for x in range(64):
for y in range(64):
var val = noise.get_noise_2d(x, y)
if val > 0.3:
set_cell(0, Vector2i(x, y), 0, Vector2i(1, 0))
9. Multiplayer RPC Setup
Task: Set up a simple multiplayer authoritative server with RPCs.
Prompt: "Create a Godot 4 multiplayer scene with a Player scene that has a NetworkSynchronizer. Use @rpc('authority') for server-only functions like SpawnBullet(). On the server, when a player presses space, call rpc('SpawnBullet', position, direction). On all peers, instantiate a bullet scene."
Example Result:
@rpc("authority", "call_remote", "reliable")
func spawn_bullet(position: Vector2, direction: Vector2):
var bullet = bullet_scene.instantiate()
bullet.global_position = position
bullet.direction = direction
get_tree().current_scene.add_child(bullet)
# On input:
if Input.is_action_just_pressed("shoot"):
rpc("spawn_bullet", global_position, Vector2.RIGHT)
Expert Prompts (Cross-Engine Optimization)
10. GPU Instancing in Unity
Task: Optimize rendering of thousands of identical objects.
Prompt: "In Unity, write a C# script that uses Graphics.DrawMeshInstanced to render 10,000 cubes efficiently. Create an array of Matrix4x4 for transforms. Set material.enableInstancing = true. Call DrawMeshInstanced every frame in OnRenderObject. Use a MaterialPropertyBlock to pass per-instance color."
Example Result:
private Matrix4x4[] matrices = new Matrix4x4[10000];
private MaterialPropertyBlock block;
void Start()
{
block = new MaterialPropertyBlock();
for (int i = 0; i < 10000; i++)
{
matrices[i] = Matrix4x4.TRS(
Random.insideUnitSphere * 100,
Quaternion.identity,
Vector3.one
);
}
}
void OnRenderObject()
{
Graphics.DrawMeshInstanced(mesh, 0, material, matrices, 10000, block);
}
11. LOD System in Unreal
Task: Implement level-of-detail for a static mesh.
Prompt: "In Unreal Engine 5, set up a custom LOD system using LODActor. Create three static meshes: high poly (10k tris), medium (3k), low (500). Use SetLODScreenSize to transition at screen sizes 0.5 and 0.2. Attach to an actor and test in editor. Use the LODSync component for performance."
Example Result:
- Add Static Mesh Component, set LOD Group to "SmallProp".
- In detail panel, LOD 0: HighPoly, LOD 1: MedPoly (ScreenSize 0.5), LOD 2: LowPoly (ScreenSize 0.2).
12. ECS Architecture in Godot
Task: Refactor a bullet hell game using Godot 4's ECS (Entity Component System) via GDScript.
Prompt: "Design a simple ECS in Godot 4 without using external libraries. Create an EntityManager that holds a Dictionary
Example Result:
# Component example
class_name PositionComponent extends Resource
var x: float = 0
var y: float = 0
# System example
class MovementSystem:
func update(entities: Dictionary):
for entity_id in entities:
var comps = entities[entity_id]
if comps.has(PositionComponent) and comps.has(VelocityComponent):
var pos = comps[PositionComponent]
var vel = comps[VelocityComponent]
pos.x += vel.vx * delta
pos.y += vel.vy * delta
Practical Tips and Best Practices
Version Control
- Always use Git with a .gitignore for your engine (Unity: Library/, Temp/; Unreal: DerivedDataCache/, Intermediate/; Godot: .import/).
- Use LFS for large binary assets (textures, audio, FBX).
Profiling
- Unity: Use the Profiler window (Window → Analysis → Profiler) to identify GC spikes.
- Unreal: Use
stat unitin console to see frame breakdown. - Godot: Enable Monitor in Debugger to track memory and FPS.
Code Organization
- Follow naming conventions: PascalCase for classes, camelCase for variables,
m_prefix for member variables in Unity C# (optional but common). - In Unreal, use U prefix for UObject-derived classes, A for Actors.
- In Godot, use snake_case for variables and PascalCase for nodes.
Conclusion
These 30 prompts cover the essential spectrum of game development — from basic player controllers to advanced ECS patterns. The key is to adapt each prompt to your specific project needs. Start with the basics, test in a sandbox scene, and gradually integrate more complex systems. Remember that clean code and performance profiling are as important as feature implementation. For a deeper dive into integrating these scripts with external APIs or services, ASI Biont supports connecting Unity and Godot projects to cloud backends via HTTP requests — see the flexible integration guides on asibiont.com/courses.
Happy developing, and may your framerates be high and your bugs few!
Comments