Skip to content

Instantly share code, notes, and snippets.

View benui-dev's full-sized avatar
🌱

benui benui-dev

🌱
View GitHub Profile
@intaxwashere
intaxwashere / customthunkexample.md
Last active June 8, 2024 12:08
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
@rtm223
rtm223 / RTMNavBoundaryComponent.cpp
Last active November 9, 2022 03:19
UE4/5 navmesh helper to detect Navmesh boundaries
#include "RTMNavBoundaryComponent.h"
#include "NavigationSystem.h"
#include "NavMesh/RecastHelpers.h"
#include "NavMesh/RecastNavMesh.h"
#include "Navmesh/Public/Detour/DetourNavMesh.h"
const FRTMNavBoundary FRTMNavBoundary::EMPTY = {{}};
DECLARE_LOG_CATEGORY_CLASS(LogRTMNavBoundaryComponent, Log, All)
@prime31
prime31 / ExampleUsage.cs
Last active October 24, 2022 09:51 — forked from MattRix/ObjectInspector.cs
Generic inspector class that lets you implement OnScene/InspectorGUI in your class file instead of in a separate custom editor. It also provides attributes for getting Vector3/Vector3[]/List<Vector3> editing capabilities right in the scene view and getting buttons for any methods in your class in the inspector.
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class ExampleUsage : MonoBehaviour
{
// this attribute will add handles for your Vector3s so that you can drag them around in the scene view