I’m just starting to dig into C++ (adding axis controls to a new CharacterMovementComponent) and I’m having trouble backtracking functions on components back to their source in C++ to see how they work. There’s a “Goto Code Definition” option in the right-click menu on component functions in blueprint, which sounds like it’s exactly what I need, but it’s greyed out. I have the UE4 source code installed, although I haven’t built it (I just have it for reference, I’m trying to keep all new code confined to my project to make integrating new editor versions easy). Do I need to be running a version of the editor I built myself to use this function, or does it just not work yet at all, or is there another setting somewhere I have to find to point UE4 towards the engine code?
Just experimented a little myself with this. Turns out you do need to build the editor yourself for that command to work.
If you don’t want to do that (and don’t mind a lot of searching for the right functions) the code for the blueprints seems to be under \Engine\Source\Runtime\Engine\Private\ in files starting with Kismet, like KismetMathLibrary.cpp.
I’ve also just taken a look and found some issues with the code that determines if the Goto Code Definition is active or not. This feature is intended to be enabled for any blueprint node that wraps a native function so in this case it sounds like it should have been active. The current state of the code would appear to be confusing the issue here, if you are building the Editor try changing
UClass* OwningClass = FunctionNode->FunctionReference.GetMemberParentClass( FunctionNode );
UFunction* FunctionPtr = FunctionNode->FunctionReference.ResolveMember<UFunction>( FunctionNode );
UClass* OwningClass = FunctionPtr ? FunctionPtr->GetOuterUClass() : NULL;
I will add these changes into the code as soon as it is reviewed.
Please be aware though, I came across another blocking issue for this feature with VisualStudioSourceCodeAccessor Module and this is also being looked into separately.
*** Update *** Just committed CL 2064266 and this feature should now be working as intended in main latest. The other blocking issue has also been resolved.
You don’t need to build from source for “go to definition “ to work guys: