Pages

quinta-feira, 7 de agosto de 2014

Statue: Components




In this article we will create the blueprint of the statue, which is the item that should be collected by the player. Create a new Blueprint labeled "Statue" based on the "Actor" class. If you have any doubts about how to do this, take a look at the article "Creating the first Class Blueprint", but do not create any action in EventGraph. The actions of this Blueprint will be seen in the next article.
 
Change the Blueprints editor to the "Components Mode". The first thing we will do is add the "Static Mesh" that visually represents the blueprint in the game. Click the combo box "Add Component" and choose the "Static Mesh" option:



In the "Details" tab, "Static Mesh" category, click the combo box and search for "statue". Select the "Static Mesh" with the name "SM_Statue" as the image below.


In the "Rendering" category click the "+" button to add a new material that will be applied to the statue:


Click the combo box and search for "gold". Select the Material with the name "M_Metal_Gold":


In the "Collision" category click the combo box next to "Collision Presets" and select the "OverlapAll" option, so that the statue does not block the movement of the player.


In the article "Initial preparation of the game" we measure in the Z axis the distance from the origin to the floor of the scenario. The value found was 125. The statues are created at random positions, but the axes that vary are the X and the Y. The value of the Z axis will always be 125 so the statue appear correctly on the floor of the scenario.

However for this to work we need to add a "Scene" component in the blueprint of the statue. Click the "Add Component" button and search for "scene". Select the option whose name is just "Scene" as the image below:


Then drag the name of the "Scene" component so that it is above the "StaticMesh":


Select the component with the StaticMesh and set the value of Z equal to 125 in the "Transform" category, line "Location":



With that we finished the modifications in the "Components" mode of the statue.