UE4 official AEC blueprint case course study notes

Official website: https://learn.unrealengine.com/course/2938064?r=False&ts=637944176479533337
Station B website: https://www.bilibili.com/video/BV1E7411p7a3?p=1&vd_source=707ec8983cc32e6e065d5496a7f7 9ee6

Tutorial introduction

  • The tutorial starts with blueprints, and makes trigger-triggered automatic doors, ray-triggered lights, lights that automatically attach to the ceiling in edit mode, and chairs that can change materials when approaching prompts
  • The tutorial is relatively simple. Novices are advised to start learning and appreciate the charm of blueprints

Make Automatic Doors

  • In UE, generally an interactive object will be encapsulated into a blueprint class, including all models, actions and external interfaces. Implements a very clear concept of classes.
  • Blueprint class Actor, analogous to Unity's GameObject; general interactive objects will create Actor
  • Create a BP_AutoDoor
    insert image description here
  • Add a Box Collison, so that the ActorBeginOverlap and ActorEndOverlap events can be used in the blueprint class (here the event is a bit automatically bound)

Note: The box should be as large as possible, so that the moving door will not leave the range of the box, otherwise there will be a bug that removes the character when the moving door is opened.

  • TimeLine is a function that returns a set value over time. Here a curved animation is provided for opening the door. Combined with the entry and exit of the Box collider, the corresponding actions of forward broadcast and reverse broadcast are realized.
  • TimeLine provides a curve change of 2 seconds, 0-1, combined with the Alpha value of Lerp to realize the change from A value to B value. These are common usages.
  • In the case, to get the position of the door, Get Relative Transform is used, which is the same as Get Relative Location.

ray-triggered lights

  • In UE, some common codes will be written on the character, GameMode, and Level Blueprints, and some action keywords will be set in Input; in this case, the code that triggers the light switch needs to be written on the character.
  • The objects involved in the blueprint here are:
    (1) Role: Press the mouse, emit a detection ray, and detect the object type, and if it is a suitable object, then send the interface action command Light Switch to this object (2) Switch: Set the
    Light Switch interface, And display the Switched interface command of all lighting types
    (3) Lighting: Set the Switched interface, and set the brightness of the light according to FlipFlop (AB rotation)
  • Ray logic: Set the ray distance between Start and End. If there is an object in contact, judge the object category. If the category is correct, send an interface command.

Object encapsulates action, open interface


Automatic adsorption ceiling

  • In Construction, it runs in the editor, which realizes the simple function of absorbing the ceiling; if you want to absorb the ground, just press PageDown

change material chair

  • Combining the above cases, it is not difficult to solve
  • Tooltip text triggered by colliders
  • Set the default material with SetMaterial

In the blueprint class, you can drag the model or another blueprint in the main window to this blueprint class; it is not necessary to use the Add Component button


Summary: Compared with Unity, UE has a very strict packaging concept; therefore, it is recommended to put the Mesh, blueprint class, material, and texture (if not reused) of a model together, which is more conducive to project migration.

Guess you like

Origin blog.csdn.net/qq_17523181/article/details/126002743