Skip to content

Instantly share code, notes, and snippets.

View Solessfir's full-sized avatar

Constantine Romakhov Solessfir

View GitHub Profile
@norlin
norlin / UE5-Project.sublime-build
Last active March 26, 2026 15:34
Build system for Unreal Engine projects for Sublime Text
{
"cmd": [
// Default path for UE 5
"C:/Program Files/Epic Games/UE_5.0/Engine/Build/BatchFiles/Build.bat",
// Build configuration is set to "Development" by default
"Development",
// The platform is set to Win64 by default
"Win64",
"-Project",
// The Sublime project name must match the Unreal project filename
@benui-dev
benui-dev / IsOverUIElement.h
Created October 27, 2021 17:19
Hacky way to see if the cursor is over a UI element. Useful for detecting whether to do raycasts into the world or not.
static const FString RootName = "SGameLayerManager";
bool IsOverUIElement()
{
FVector2D CursorPos = FSlateApplication::Get().GetCursorPos();
FWidgetPath WidgetPath = FSlateApplication::Get().LocateWindowUnderMouse( CursorPos, FSlateApplication::Get().GetInteractiveTopLevelWindows() );
if ( WidgetPath.IsValid() )
{
const FArrangedChildren::FArrangedWidgetArray& AllArrangedWidgets = WidgetPath.Widgets.GetInternalArray();
@iUltimateLP
iUltimateLP / GetP4Changelist.cs
Last active May 22, 2025 16:00
Example Unreal Engine 4/5 Build.cs script that automatically fetches the current Perforce changelist and embeds it into code
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
using System;
using UnrealBuildTool;
using System.Diagnostics;
public class BuildScriptUtils
{
// Runs p4.exe to determine the current changelist
// Returns true if it could determine the changelist, false if not
#include "AsyncMoveTo.h"
#include "AIController.h"
#include "AISystem.h"
#include "NavigationSystem.h"
#include "Logging/MessageLog.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(AsyncMoveTo)
DEFINE_LOG_CATEGORY_STATIC(AsyncMoveTo, Warning, All);
@intaxwashere
intaxwashere / YourProjectEditorModule.cpp
Last active April 25, 2024 11:01
Automatically adding category sections to editor
// add this code to your StartupModule() function of your EDITOR module
// if it doesnt work, try setting loading phase to "postdefault" -- no idea if this will produce side effects though.
// basically idea is looping all CDOs (i.e. UClasses) and their properties, getting their "category" meta value and registering them to
// property sections
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
static constexpr bool bAddSubcategories = false; // you probably want this to be false
auto ProcessCategory = [&PropertyModule](const FName ClassName, const FString& Category)
@MilkyEngineer
MilkyEngineer / Minimal-5.2.uproject
Last active January 12, 2026 13:49
Minimal project descriptor that "Disables Engine Plugins by Default" for Unreal Engine
{
"FileVersion": 3,
"EngineAssociation": "5.2",
"Description": "Minimum viable plugin dependencies for a usable Unreal Engine project",
"DisableEnginePluginsByDefault": true,
"Plugins": [
{
"Name": "PluginBrowser",
"Enabled": true
},
@intaxwashere
intaxwashere / customthunkexample.md
Last active March 27, 2026 10:19
Custom Thunks Unreal Engine TL;DR

Custom thunks TL;DR

This smol post assumes you worked on a custom thunk implementation before but no idea how it works, why you're using cursed macros from 1990s etc. If you don't have any programming experience or relatively new to Unreal world, it's likely you might not understand anything from this post, not because concepts are too difficult to grasp, but rather because this post is written for the people who has an understanding of how Unreal works since a while and want to expand their knowledge of custom thunks implementation.

Part 1:

  • A thunk is a function that you can save and call later, so if you had an array of TFunction<void()>s, you would have an array of custom thunks that you can bind/unbind new function pointers to existing TFunctions.
  • Custom thunks of Blueprints are the same, they're a fancy array/list of function pointers. Imagine for each node you placed to graph, Blueprints have a place for that node in it's list of custom thunks. For example the + node in Blueprints that
@ldl19691031
ldl19691031 / WorkGraphExampleShader.usf
Created August 16, 2024 12:13
UE DispatchComputeShaderBundle example
#include "/Engine/Private/Common.ush"
struct FShaderBundleNodeRecord
{
uint DispatchGridSize : SV_DispatchGrid;
};
#include "/Engine/Shared/HLSLReservedSpaces.h"
struct FUERootConstants
{
@ThioJoe
ThioJoe / !AddCompressToMenu -- How-To-Use.txt
Last active November 30, 2025 23:36
Add "Compress To" Option to Old Windows 11 Start Menu - Registry Tweak
How To Use:
1. Choose which version you want to use:
- "Full Menu" Version: The same as the original one in the new context menu, and has multiple sub-menu items
- Other Version: Doesn't have a sub-menu, it just directly opens the "Create Archive" menu. (The equivalent of clicking the "Additional Options" sub-item in the original)
2. Double click the "Add_" reg file of whichever version you choose
3. Restart Windows Explorer
- You can restart it by opening Task Manager with Ctrl+Shift+Esc, then search it for "Windows Explorer", right click that and hit "Restart"
@timoxley
timoxley / MyWorldSubsystemBlueprintBase.h
Last active July 30, 2025 15:17
Subclass this to implement a world subsystem in Blueprint. Supports Timers! #unrealengine #ue5
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Editor.h"
#include "Engine/AssetManager.h"
#include "Engine/BlueprintGeneratedClass.h"
#include "Engine/World.h"