Introduction
You're building a game. You've got the engine open, but your progress is stuck on repetitive tasks — writing boilerplate code, debugging shaders, balancing enemy stats. AI can cut that time in half if you know the right prompts. This article collects 12 battle-tested prompts for Unity (C#), Unreal Engine (Blueprints/C++), and Godot (GDScript). Each prompt comes with a real usage example and the exact output you can expect. No fluff — just practical tools used by indie devs and studio teams.
1. Unity: Generate a Player Controller with Basic Movement
Prompt:
"Write a Unity C# script for a first-person player controller with WASD movement, mouse look, and sprint (Shift key). Use CharacterController, include gravity and jump. Add comments explaining each section."
Why it works: This saves 20 minutes of wiring input, physics, and camera rotation. The AI produces a clean, commented script that handles edge cases like grounded detection and sprint stamina (if you ask).
Example output snippet:
public class FPSController : MonoBehaviour
{
public float walkSpeed = 5f;
public float sprintSpeed = 10f;
public float jumpForce = 5f;
public float mouseSensitivity = 2f;
private CharacterController controller;
private Vector3 velocity;
private float xRotation;
void Start()
{
controller = GetComponent<CharacterController>();
Cursor.lockState = CursorLockMode.Locked;
}
void Update()
{
// Mouse look
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity;
float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
transform.Rotate(Vector3.up * mouseX);
// Movement
float speed = Input.GetKey(KeyCode.LeftShift) ? sprintSpeed : walkSpeed;
Vector3 move = transform.right * Input.GetAxis("Horizontal") + transform.forward * Input.GetAxis("Vertical");
controller.Move(move * speed * Time.deltaTime);
// Jump & gravity
if (Input.GetButtonDown("Jump") && controller.isGrounded)
velocity.y = Mathf.Sqrt(jumpForce * -2f * Physics.gravity.y);
velocity.y += Physics.gravity.y * Time.deltaTime;
controller.Move(velocity * Time.deltaTime);
}
}
2. Unity: Optimize Object Pooling for Bullets
Prompt:
"Create a generic object pool in Unity C# that works with any MonoBehaviour. Include methods to spawn and despawn objects. Use a Queue for storage and support pre-warming."
Why it works: Object pooling avoids costly Instantiate/Destroy calls. This prompt gives you a reusable system that reduces garbage collection spikes — crucial for mobile games or bullet-hell patterns.
3. Unreal Engine: Create a Blueprint for Health System
Prompt:
"Design a Blueprint for a player health system in Unreal Engine 5. Include health variable (float), max health, damage function, heal function, death event, and UI update via Event Dispatcher. Use comments in Blueprint nodes."
Why it works: Blueprints can become spaghetti without structure. This prompt forces the AI to outline a clean data flow: variable → damage/heal logic → event dispatch → UI binding. You get a blueprint that’s easy to extend with shields or regeneration.
4. Unreal Engine: C++ Actor Component for Patrolling AI
Prompt:
"Write an Unreal Engine C++ ActorComponent that makes an NPC patrol between waypoints. Use a TArray of FVector points, interpolation movement, and a state machine (Patrol, Wait, Resume). Include Tick and BeginPlay logic."
Why it works: AI patrolling is a staple in stealth and action games. This component is modular — attach it to any character and assign waypoints in the editor. The state machine prevents jitter when the NPC reaches a point.
5. Godot: Procedural Dungeon Generation with TileMap
Prompt:
"Generate a procedural dungeon in Godot 4 using GDScript and TileMap. Implement a random walk algorithm that carves rooms and corridors. Use a 2D array for collision data. Return the TileMap with walls and floors."
Why it works: Random walk is simple and produces organic layouts. This prompt gives you a working script that fills a TileMap layer with floor tiles and surrounding walls. You can tweak room size and corridor length.
6. Godot: Inventory System with Grid Layout
Prompt:
"Create a grid-based inventory system in Godot 4 using GDScript. Include an InventoryData resource (with item name, icon, stack size), a InventoryGrid class that holds items in slots, and drag-and-drop UI. Use signals for updates."
Why it works: Inventory is one of the most requested features in RPGs. This prompt structures data (Resource) separately from logic (Grid) and UI (Control nodes), making it easy to expand with crafting or equipment slots.
7. Unity: Shader Graph for Dissolve Effect
Prompt:
"Create a Shader Graph for Unity URP that applies a dissolve effect to a material. Use a noise texture as the dissolve mask, a slider for the dissolve amount, and an emission color for the edge glow. Include a SubGraph for the edge detection."
Why it works: Shaders are intimidating for beginners. This prompt gives you a visual node setup (in text) that you can replicate in the Graph window. The edge glow adds polish for enemy death or teleportation effects.
8. Unreal Engine: Niagara System for Fire Particles
Prompt:
"Design a Niagara emitter in Unreal Engine 5 for a campfire. Use two particle types: flame (small, fast, orange/yellow) and smoke (larger, slow, gray). Add a wind vector parameter to drift particles. Use GPU particles for performance."
Why it works: Fire is a common VFX need. The prompt specifies GPU particles (cheaper than CPU for many particles) and layered effects (flame + smoke) for realism. The wind parameter lets you reuse the system for torches or fireballs.
9. Godot: State Machine for Enemy AI
Prompt:
"Implement a finite state machine in Godot 4 using GDScript for an enemy AI. States: Idle, Patrol, Chase, Attack. Use an enum for states, a timer for transitions, and a simple distance check to switch between Patrol and Chase."
Why it works: State machines decouple AI logic from the enemy’s main script. This implementation uses a clean switch-case pattern (or match statement) and a timer to prevent instant state flips. You can add new states (e.g., Flee, Stun) without breaking existing ones.
10. Unity: Save System with JSON
Prompt:
"Build a save/load system in Unity C# that serializes game data (player position, inventory, health) to JSON using JsonUtility. Include a SaveManager singleton, auto-save on scene change, and a load button. Handle missing file gracefully."
Why it works: JSON is human-readable and easy to debug. This prompt covers serialization, file I/O (Application.persistentDataPath), and error handling. The singleton pattern ensures one save manager across scenes.
11. Unreal Engine: Multiplayer Replication for Pickups
Prompt:
"Create a pickup actor in Unreal Engine 5 C++ that replicates to all clients. Include a sphere collision, a UPROPERTY(Replicated) for whether it’s collected, a multicast RPC for the collect animation, and a respawn timer."
Why it works: Multiplayer replication is tricky. This prompt forces the AI to handle ReplicatedUsing, RPCs, and NetMulticast — core concepts for any networked game. The respawn timer prevents permanent despawn on a single client.
12. Godot: Audio Manager with Bus System
Prompt:
"Write a GDScript AudioManager for Godot 4 that uses AudioStreamPlayer2D and AudioBuses. Include methods to play SFX (with random pitch variation) and BGM (with crossfade). Store sounds in a Dictionary keyed by string names."
Why it works: Audio is often an afterthought. This manager centralizes playback, applies pitch variation (reduces repetition), and crossfades BGM for smooth transitions. The Dictionary approach makes it easy to call AudioManager.play("explosion") from any script.
Conclusion
These 12 prompts cover the most common pain points in Unity, Unreal Engine, and Godot — from player movement and AI to VFX and multiplayer. Copy-paste them into your AI tool of choice, adjust the parameters (speeds, colors, distances), and you’ll have working code in minutes. The key is specificity: include engine version, component names, and desired features. Start with one prompt today — pick the one that matches your current blocker — and see how much time you save.
Comments