Tag: c++

  • Unreal Engine: Fixing the ‘Pin Context Object must have a connection’ Issue

    Unreal Engine: Fixing the ‘Pin Context Object must have a connection’ Issue

    I wanted to empower my sound designer to create simple blueprints that respond to Game Events. To achieve this, I created a custom class inheriting from a UObject to encapsulate the blueprint script. However, in this object blueprint, when attempting to access a Service (or any static method with a hidden World Context Object pin),…

  • Optimize Debugging in Unreal Engine with Cheat Codes

    Optimize Debugging in Unreal Engine with Cheat Codes

    Whether it’s for QA testing or during playtesting, maintaining control over your game is essential to efficiently tackle bugs, obstacles, and repetitive tasks. While developers commonly bind inputs to cheat codes – like associating F5 with invincibility – this approach has its limitations: A more effective solution is employing console commands. Triggered by the backtick…

  • How to calculate an Actor Oriented Bounding Box (OBB) With Unreal Engine

    How to calculate an Actor Oriented Bounding Box (OBB) With Unreal Engine

    To obtain an Oriented Bounding Box (OBB) for an object, we first need to retrieve the local Axis Aligned Bounding Box (AABB) and then construct our OBB using a center and an extent vector transformed with the Actor’s world Transform. While the AABB consists of a single Extent vector representing the magnitude on each axis…

  • Following function will split a circle in equidistant NumPoints, and return a position on the circle according to the index of the point (defined by PointId).

  • How to Spawn an AI Controller Pawn in Unreal Engine

    Use “Spawn AI From Class” to Spawn an AI Character If you want to spawn a Non-Player Character (NPC), you should use the “Spawn AI From Class” node in Unreal Engine, rather than “Spawn Actor for Class”. This is because an AI character is actually composed of two actors: the pawn and the controller (which…

  • Configure UTickableWorldSubsystem

    This subsystem lives along with the world and is initialized and destroyed at the same time. It’s a subclass of UWorldSubsystem, but with a Tick function. This class is particularly useful for creating a “Game Master” system to manage game events, like spawning enemy waves or handling level transitions. To use UTickableWorldSubsystem, you need to…

  • Deactivate an Actor Component (and why it may not work for you)

    Deactivate an Actor Component (and why it may not work for you)

    When working with Unreal Engine 5.1, you may need to disable an Actor component at some point in the game. The most straightforward way to do this is by calling the Deactivate() function on the component. However, you may notice that even though you have called this method, the component still seems to be activated…

  • How to create a blueprint node with multiple exec pins.

    To create a blueprint node with multiple exec pins in Unreal Engine, you can use the ExpandEnumAsExecs meta tag in the UFUNCTION macro to specify the number of outputs The ExpandEnumAsExecs meta tag is a special meta tag that can be used in conjunction with an enum parameter in a blueprint function to automatically generate…

  • How to write a Dialog system with Unreal 5.1

    Create a new Widget Blueprint To display a Dialog Box, we first need to create a Widget to display on the screen that contains a text box. In Unreal Engine, you can create a new Widget Blueprint by right-clicking in the Content Browser, selecting “User Interface,” and then “Widget Blueprint.” Give your new Widget Blueprint…

  • Understanding the couple Pawn (or Character) and Controller

    Using an AController in combination with a Pawn provides a more robust and flexible system for controlling game characters and NPCs, both from a player and AI perspective. In Unreal Engine, a Pawn represents a player or non-player character that can be controlled in the game world. The AController is responsible for managing the Pawn’s…