4. On Your Own!

Using what you have learned, try to do the following:

  • Create an Actor that moves or rotates to a target transform when an Event is run. This could be used as a moving platform or door in a game. Make the Event start a Timer that will trigger a second Event which moves the Actor back to its original location. Use exposed variables (via UPROPERTY) instead of hard-coded values wherever appropriate.

  • Make a lit torch that burns out (perhaps by deactivating a fiery Particle System Component) by using a Timer handle and a few custom Events. For example, an AddFuel Event could extend the burning time of the torch. A DouseWithWater Event could shut it off immediately and prevent AddFuel from working in the future. Both of these features can be written without using a Tick, simply by modifying a running Timer through its handle.

As for the specifics covered in this tutorial:

  • For more information about Timers, try the Gameplay Timers page.

  • For a complete reference using the UPROPERTY tag with variables in your classes or structs, look at the Properties page.

  • To learn more about UFUNCTIONS and Event creation, check the Functions page.

  • For further tutorials, see the C++ Programming Tutorials page.