Using a class or struct as a blueprint variable

Types that you declare in C++ do not automatically get incorporated into Blueprint for use as variables. This recipe shows you how to make them accessible so that you can use custom native code types as Blueprint function parameters.

How to do it…

  1. Create a new class using the editor. Unlike previous chapters, we are going to create an Object-based class. Object isn't visible in the default list of common classes, so we need to tick the Show all classes button in the editor UI, then select Object. Call your new Object subclass TileType.
    How to do it…
  2. Add the following properties to the TileType definition:
    UPROPERTY() ...

Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.