Endless Runner 5 - Varying the Course

# Endless Runner
## 5 - Varying the Course

[![5 - Varying the Course](http://img.youtube.com/vi/OVrfHO2DdOs/0.jpg)](https://www.youtube.com/watch?v=OVrfHO2DdOs)


### BP_FloorTileのChild Blueprint Class：BP_FloorTile_RampUpを作成する

BP_FloorTileを右クリック
Create Child Blueprint Classを選択し、Child Classを作成する
![image](https://qiita-image-store.s3.amazonaws.com/0/111261/ea268dbf-1a28-1bb8-b544-9d2c1b53e264.png)

#### StaticMesh：Rampを追加する

|名前  |追加するコンポーネント  |
|---|---|
|Ramp |Static Mesh |

#### Rampの詳細を設定する

Static Mesh: Static Mesh

|項目名  |値  |
|---|---|
|Static Mesh |Shape_Wedge_B |

Transform

|項目  |X  |Y  |Z  |
|---|---|---|---|
|Location  |1250.0  |0.0  |0.0  |
|Rotation  |0.0  |0.0 |180.0 |
|Scale  |5.0  |10.0  |3.0  |

Materials

|項目名  |値  |
|---|---|
|Elements 0|M_Tech_Hex_Tile_Pulse |

![image](https://qiita-image-store.s3.amazonaws.com/0/111261/c772b52d-d2ba-3632-7a16-1e135b1d6a0a.png)

#### AttachPointの位置をRampの上部中央に移動する

Transform

|項目  |X  |Y  |Z  |
|---|---|---|---|
|Location  |1500.0  |0.0  |280.0  |
|Rotation  |0.0  |0.0 |0.0 |
|Scale  |1.0  |1.0  |1.0  |

![image](https://qiita-image-store.s3.amazonaws.com/0/111261/9456171b-6f05-3bb4-7f79-8f4878e3d3d4.png)

#### EndTriggerの位置をRampの上部中央に移動する

Transform

|項目  |X  |Y  |Z  |
|---|---|---|---|
|Location  |1500.0  |0.0  |475.0  |
|Rotation  |0.0  |0.0 |0.0 |
|Scale  |1.0  |1.0  |1.0  |

![image](https://qiita-image-store.s3.amazonaws.com/0/111261/fbf3778c-37ee-641a-7fb3-053b44c9f120.png)

### RunGameModeのAddFloorTileをBP_FloorTileかBP_FloorTile_RampUpのいずれかを追加するように変更する

#### 変数：FloorTilesを追加する

|変数名  |変数の型  |
|---|---|
|FloorTiles |Actor(Class)(配列) |

![image](https://qiita-image-store.s3.amazonaws.com/0/111261/4873ae7e-bba1-2b7d-897d-504931c790f9.png)

処理を実装
![image](https://qiita-image-store.s3.amazonaws.com/0/111261/70a29cfb-5aec-99a7-c929-743fb323601a.png)

コンパイル -> 保存 -> Class Default

FloorTiles

|インデックス  |値  |
|---|---|
|0 |BP_FloorTile |
|1 |BP_FloorTile_RampUp |

![image](https://qiita-image-store.s3.amazonaws.com/0/111261/ff297841-c286-ae22-0a2b-55bb838211d7.png)

プレイして確認する
![image](https://qiita-image-store.s3.amazonaws.com/0/111261/09049d38-496b-15d1-1694-79e19c448f33.png)

### BP_FloorTile_RampDownを作成する

#### BP_FloorTile_RampUpからDuplicate（複製）してBP_FloorTile_RampDownを作成する
 
BP_FloorTile_RampUpをDuplicateする
![image](https://qiita-image-store.s3.amazonaws.com/0/111261/df393f85-9816-88ec-6acf-fac1b3de13d6.png)

BP_FloorTile_RampDownに名前を設定する
![image](https://qiita-image-store.s3.amazonaws.com/0/111261/99c96c16-aeb9-5d6f-08ec-aceabc22dd41.png)

#### Rampを下り坂になるように移動する

Transform

|項目  |X  |Y  |Z  |
|---|---|---|---|
|Location  |1250.0  |0.0  |-300.0  |
|Rotation  |0.0  |0.0 |0.0 |
|Scale  |1.0  |1.0  |1.0  |

![image](https://qiita-image-store.s3.amazonaws.com/0/111261/9496c767-af7d-df3f-1f7a-88accab88307.png)

#### AttachPointを下り坂の終わりに移動する

Transform

|項目  |X  |Y  |Z  |
|---|---|---|---|
|Location  |1500.0  |0.0  |-300.0  |
|Rotation  |0.0  |0.0 |0.0 |
|Scale  |1.0  |1.0  |1.0  |

![image](https://qiita-image-store.s3.amazonaws.com/0/111261/463720dd-c5b4-9c66-6f5a-29ae14656a53.png)

#### EndTriggerを下り坂の終わりに移動する

Transform

|項目  |X  |Y  |Z  |
|---|---|---|---|
|Location  |1500.0  |0.0  |-135.0  |
|Rotation  |0.0  |0.0 |0.0 |
|Scale  |1.0  |1.0  |1.0  |

![image](https://qiita-image-store.s3.amazonaws.com/0/111261/e326b00f-98ca-1ece-afa1-a2991f3fb893.png)

#### RunGameModeのFloorTilesにBP_FloorTile_RampDownを追加する。

FloorTiles

|インデックス  |値  |
|---|---|
|0 |BP_FloorTile |
|1 |BP_FloorTile_RampUp |
|2 |BP_FloorTile_RampDown |

![image](https://qiita-image-store.s3.amazonaws.com/0/111261/7e06ca95-0de4-93e3-7daa-6e08d34e2818.png)


プレイして確認する

コースに直線、上り、下りが作成される
![image](https://qiita-image-store.s3.amazonaws.com/0/111261/c597f09c-6baf-2b77-6db1-3a85682ca113.png)