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.
How to use it
Section titled “How to use it”-
Switch to the Declaration (
.h) pane. -
Put the cursor on the function declaration you want to implement.
-
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 }Where the stub lands
Section titled “Where the stub lands”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.
Good to know
Section titled “Good to know”- It works from a single declaration at the cursor, including its
UFUNCTIONmacro 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.