![]() ![]() Right-click on Trigger again and choose Add Event -> Add OnComponentEndOverlap. In the MyBlueprint window, Right-click on the Trigger and choose Add Event -> Add OnComponentBeginOverlap. We are going to Enable Input (when the player is inside) or Disable Input (when the player is outside) of the sphere. In the Details panel, set the Variable Name to Trigger, the Z Transform to -180.0, and Scale for X, Y, Z to 8. ![]() In the Components panel, click the Add Component, then search for and add Sphere Collision. Inside the StarterContent/Blueprints folder, open the Blueprint_CeilingLight asset. We would want to Enable/Disable Input based on if the player is near the light, similar to the below: If we were to use the method above of Enabling Input on Event Begin Play and had a Key Press that turned on or off a light (for example), the player would be able to turn that light on/off from anywhere in the world. While the methods noted above work for Enabling/Disabling Input, typically you would want some rules to govern when to allow the Actor to receive Input from a player. When the E key is pressed, we print to the screen some text then Disable Input on the Actor so that they can no longer provide input to the Actor.Īs with the Enable Input node, the Disable Input node requires that a Target and Player Controller be specified. In the example above, we used the aforementioned method of enabling input on the Actor then added an E Key Event. Just as you can Enable Input on an Actor, you can also Disable Input for an Actor by using the Disable Input node. The default Player Controller uses Player Index 0 for Single Player games, if you were to have a multiplayer scenario, you could specify which player through the Player Index value. In the example above, the Event Begin Play node states that when the game is started (provided the Actor exists in the level), Enable Input for the Player Controller specified. With this setup, you could now search for and add Input Event nodes (such as a Key or Mouse Button press) and perform actions that affect the Actor when those keys are pressed. The Enable Input node requires that a Target (usually Self - the Actor itself) as well as a Player Controller (the player that will be providing the input) be specified. This is the basic method in which you can enable input on an Actor. In the graph, Right-click search for and add the Enable Input node.Ĭonnect the out pin of the Event Begin Play to the in pin of the Enable Input node.Ĭonnect the Get Player Controller node to the in Player Controller pin on the Enable Input node. ![]() In the graph, Right-click search for and add the Get Player Controller node. On the Event Graph tab, Right-click in the graph and search for then add the Event Begin Play node. Inside the StarterContent/Blueprints folder, open the Blueprint_Effect_Fire asset. The steps below will show you how to Enable Input for an Actor: Left-click the Asset, then drag it into the Level Viewport and drop it at the location where you want to place it.For this example, we are using the Blueprint First Person Template with Starter Content. In the Content Browser, find the Asset you want to place. You can add Actors to your Level from the Content Browser by using drag and drop. You can also use this method to replace the selected Actor with any Actor that is also available from the Place Actors panel. Right-click the Actor or Actors in the Level Viewport to open the context menu. In the Content Browser, select the Actor you want to replace another Actor with. To replace one or more Actors, follow the steps below: This can be useful if you want to swap multiple Assets at once. You can also use the context menu to replace one or more Actors in the Level Viewport with an Asset you selected in the Content Browser. Click any Actor you see in this section to place it. To see the types of Assets you can add, right-click anywhere in your Level Viewport, then hover over the Place Actor section. You can also use the context menu to quickly add different types of Assets to your level, even when you have a specific Asset selected in the Content Browser. Click the image for full size.Īfter selecting the Asset from the context menu, you will see it appear inside your Level at the coordinates where you right-clicked. Placing an Actor from the Content Browser into a Level using the context menu. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |