![]() ![]() Macros take the nodes from the macro graph, and actually replace the macro node with a copy of all those nodes. That means you can target them ("call a function on another object"), and they provide communication There are some key differences that will become more apparent as you get into more advanced use cases.įunctions are called when you place nodes to call the function. Macros use "anonymous" local variables, which don't have a specific name, but just hold a value.īoth are awesome ways to encapsulate functionality for reusability and clarity. ![]() They accomplish these in two different ways, but they have some similarities:īoth have a central place where you can edit the functionality of what the node does (macros in their macro graph, and functions in their function graph), and every node that calls the function or macro will be updated whenever that central place is changed.īoth allow for local variables. They're the things you don't want to forget about after you use them.įunctions and Macros both accomplish the same goal externally: they let you send input into a node, something happens to it, and then outputs come out. References to meshes or other components, or variables that need to be public so you can access them from other Blueprints, should be class variables. You can use them to help perform what the function needs to, but they get tossed away after the function has completed.Ĭlass variables are for things that you are interested in accessing from multiple places in the Blueprint. You can consider local variables a "scratch pad" to work within a function. This helps to reduce clutter for things that are only relevant within the context of that function. A local variable in a function is only visible to that function, and not to other functions, or the Event Graph. Local variables are scoped, which means that they only exist where you define them. When you're inside a function, you'll see an additional section of the My Blueprint tab for Local Variables. When you're working in your Blueprint, you have the ability to add variables using the Blueprint Editor My Blueprint Panel tab. Refer to Level Blueprint and Blueprint Class for additional documentation.) Class Variables vs. When you copy functions from a Level Blueprint that operate on Actors (for example, calling Set Brightness on a light), and paste them into a Blueprint Class based off of a Light Actor, the functions will update to be in the proper scope. ![]() If you do start out in the Level Blueprint and decide to move behavior into a Blueprint Class. If you create a Blueprint Class, you can add it to any of your levels, and you can add as many copies as you would like to the level, without needing to copy any additional script. In general, Blueprint Classes are the best way to get reusable behavior in your project. Some examples would be kicking off a cinematic when a certain trigger is touched, or opening a particular door after you kill all the enemies. Level Blueprints can be used to set up functionality specific to the level, or Actors in it. They're useful for prototypes, and getting familiar with the Blueprints system, but they are specific to the level that they're used in. Level Blueprints may be familiar to you if you have used UE3's Kismet, because you can select objects directly in the level and operate on them. This guide will go over some of the more common decisions you will have to make, as well as tips and tricks for Blueprint users. If you would like to read more about coding for Blueprints, or the technical details of Blueprint compiling, see the Blueprints Technical Guide.Įven if your functionality is well-suited for Blueprints, there are decisions you can make in setting up your Blueprints that will make things go more smoothly. Blueprints are best suited to making event-driven functionality, such as handling damage taking, controls, and other functionality that does not get called every frame. If you have a Blueprint that's doing a lot of operations and complex math every tick, you might want to consider using C++ code. However, there are certain things that will impact your performance more if they are done in Blueprints. Many possibilities can exist with the Blueprint visual scripting system. You can create a small game, procedural content tools, prototype new functionality, tweak and polish functionality designed by programmers. You can create many things from your imagination with Blueprints. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |