Making The Tower Fire At The Avatar[]
- Select the “View Cone” child of "Ruins Pillar 01".
- In the Properties Panel, Press the "+" on "Detected Object Event" so the "Target" field is visible.
- Then, from your Project Hierarchy: Drag "Launcher Arrow" to that "Target" field.
- Next, click the "No Function" drop down just below that "Target" field to see the available options, and select "lookAt". This will tell the launcher to look at whatever Avatar enters the view cone.
- Repeat steps 2 through 4 again, so now there are 2 items below the “Detected Object Event”, except this time, select Fire() from the “No Function” Drop down. This will fire at the player once the launcher is looking at you.
- You have now made it so when an Avatar is detected in the view cone, you make the launcher first look at, and then fire at the player. Click on the "View Cone" and set the frequency to 10, this will ensure that the arrow fires slowly at the beginning. You may decrease this value to increase the difficulty of your game.
- We are almost done with this portion, at this point it's a good idea to move (in your viewport) your Avatar to some reasonable distance away from tower for ease of play. This will just make it so you don't start the game right on top of this tower we just created.
- Now you can play to test, you should have a tower that fires arrow projectiles at you all the time.
- From here, you can optionally save your current game, and you can move on to the next part.
|