4. On Your Own!

Binding input to C++ code

Windows
MacOS
Linux

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 (that is, exposed through 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 UFunctions page.

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

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback