UE4 Event Related Summary

Source: Internet
Author: User

Transferred from: http://blog.ch-wind.com/ue4-event-overview/

The event mechanism is an important part of implementing the in-game logic, and it is necessary to understand the event mechanism of UE4 before the design and implementation of the game logic is started. So here is the UE4 of the event related content to tidy up a bit.

The UE version currently in use is 4.6.0.

UE4 built-in events

Event level Reset

This event, as its name, exists only at level Blueprint. Can only be run on the server side.

Events are emitted when the level is reset, such as when the player dies and the map is not re-loaded but reset.

Collision Detection Series

Event Actor Begin overlap

Event Actor End overlap

Event hit

The overlap event only occurs when the collision property of two objects is overlap and the Generate overlap events is checked. The hit event must have a setting of simulation generates hit events before it is issued. Collision detection events are an important trigger point for game logic.

Damage Events

Event any Damage

Additional damage caused by environmental factors such as the swamp of persistent injury.

Event Point Damage

Damage is caused by throwing objects. Usually used for bullet damage and some melee weapons.

Event Radial Damage

Radiation-like damage, usually applied to explosion damage or other indirect damage types.

The damage event is initiated only on the server side.

Interactive Events

Event Actor Begin Cursor over

Event Actor End Cursor over

The interactive event of the mouse and object as described by its name.

Logical Events

Event Begin Play

Event End Play

Compare the two frequently used events that are triggered when the actor is initialized and eliminated in the world.

Event destroyed

Triggered when the actor is destroyed, the event has been officially flagged and the function is merged into end play.

Event Tick

Clock events, which are triggered every frame.

Event Receive Draw HUD

Only events in the HUD class can be used for the logical and display design of the HUD.

Collision Detection Related

The logic of collisions and the use of ray tracing are roughly the same. The only difference is that the trace scan line itself can also have a response property, allowing the object to choose whether to block or ignore the scan line.

Some of the more important attributes are:

Ccd

Continuous collision detection. Improve the accuracy of collision detection to prevent wall piercing and prevent two collisions. It is often used in simulations of high-speed moving objects such as bullets.

Always Create Physics State

Creating physical properties while the world is loading instead of collisions can prevent a large number of physical properties from being initialized during a game run, at the expense of a longer load time.

Check Async Scene on Move

At the same time, the synchronous physical space and the asynchronous physical space are checked, and the asynchronous physical space is mainly used to simulate the damaged object.

Trace Complex on Move

If complex tracking is used, a polygon-level simulation is used. Often with simple simulations, collision graphics can be defined in the editor.

The collision attributes are preferred as follows:

Ignore>overlap>block

The corresponding logic is triggered only when two objects that participate in the simulation have the same attributes, otherwise the high priority collision logic is used. For example, two objects colliding with each other are set to overlap and block, then they will be judged as overlap.

For high-speed moving objects in the scene, the block is sometimes triggered by the overlap event, so it is not recommended to use both types of events at the same time.

More examples can be found in the official documentation.

Blueprint Communication Related

Custom events

UE4 allows you to customize events in the blueprint. The definition of an event is valid only within that blueprint.

Custom events are used essentially the same way as custom functions.

Event Scheduler

The event Scheduler triggers all events that are bound on it after it is called.

All events can be bound, untied, and unbound, and will not be called by the Scheduler if the defined events are not bound.

Blueprint Interface

The Blueprint interface allows different object types to provide the same functionality but has its own implementation, similar to the interface capabilities of C + +. There is no big problem when defining in blueprints, the only thing to keep in mind is that functions that are not output are automatically converted to events. Such as:

If you want to use it in C + +, you need to refer to the documentation.

Minimalapi

Try to expose the inner function without outward exposure. In this case, you can expose a function by assigning requiredapi to it. Although this is the official description, but the use of Requiredapi is unclear, direct use will prompt the error, there may be problems involved. Function specifiers also did not indicate that the hand is not UE4 source, because it is not likely to use this setting, so no longer study.

DependsOn

Declares a dependency relationship. Required when an interface is to be used in a definition in another class.

Dependson= (ClassName, ClassName, ...)

Cannotimplementinterfaceinblueprint

A blueprint cannot implement an interface that can only be implemented in C + +. After this designation is used, the function cannot be specified as blueprintimplementableevent in the interface. In contrast, blueprintcallable cannot be used in interfaces that are not specified to be implemented by the blueprint.

Uinterface (..., meta = (cannotimplementinterfaceinblueprint))

It is important to note that the defined interface cannot expose the property and cannot expose the function to the blueprint without using Cannotimplementinterfaceinblueprint. function is really just a simple interface.

————

UE4 Event Related Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.