Skip to content
TECHNICALLYARTIST
FAB

Generate Definition

Generate Definition turns a function declaration into a ready-to-fill implementation, so you don’t have to retype the signature, scope it to the class, and find where to put it.

  1. Switch to the Declaration (.h) pane.

  2. Put the cursor on the function declaration you want to implement.

  3. Press Ctrl + Shift + G, or pick Generate Definition from the editor’s right-click menu.

The editor reads the declaration at the cursor, builds the matching definition (return type, class scope, parameters, and an empty body), and inserts it into the Implementation (.cpp) pane.

Declaration (.h) Implementation (.cpp)
void AMyActor::Tick(float Dt); ──▶ void AMyActor::Tick(float Dt)
{
| ← cursor lands here, ready to type
}

The generator does not just append to the end of the file. It looks at the functions declared before and after the one at your cursor and places the new definition in the same relative order in the .cpp, skipping over any leading comment lines so the body lands in a sensible spot.

  • It works from a single declaration at the cursor, including its UFUNCTION macro when present.
  • It generates the signature and an empty body; the logic is yours to write (or hand to AI inline completion once the stub exists).
  • It is meant for ordinary member functions. Very unusual declarations may not parse cleanly; if a stub looks off, adjust it by hand.