BeginPlay

From ZDoom Wiki
Jump to navigation Jump to search


Actor

virtual void BeginPlay()

Usage

A virtual function used by actors. It's called right before PostBeginPlay and before the first Tick call.

This function can be overridden to perform one-time setups, like giving local variables a value, setting flags and such, before any of that data gets overridden or referenced in the states. In many cases it can be used the same way as PostBeginPlay(). However, while the actor is guaranteed to exist by the time it's called, its states are not set up, and it may not be correctly positioned in the world. As such, it should not be used for things that rely on the actor's position, such as checking the sector where it's located and such.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.