What I Did:
Today i made then enemy ship be able to shoot. To do this I first created a new script called weapon controller from the add component section of the enemy ship game object. In the weapon controller I added code telling it how to shoot. I then dragged the bolt prefab that I filed from the player ships bolts and attached it to the enemy ship so it would be a child game object of it. I added another empty game object call ed shot spawn and set it as a child object of the enemy ship, and set the bolt as a child of shot spawn. I adjusted the enemy bolt to a cyan texture so it looks different, I also reversed its movement so it would fire towards the player instead of away. After that I edited the destroy by contact script so the bolts would ignore the enemy objects if it was fired from the enemy ship. I created a new tag in unity named Enemy and tagged the enemy ship, the enemy shot and the 3 asteroid prefabs. I then filed the enemy bolt as a prefab. The enemy ship now fires and can destroy the player. Because both bolts from the player and enemy are supposed to destroy any object it touched with exception the two bolts can eliminate each other on contact.
Tutorial Started: 00:45:01
Tutorial Stopped: 01:08:19
What I Learned:
I learned how to create an object the shoots other objects independently, and how to make the object it fire lethal to some objects and not others.
What I'm Doing Next Day:
Next day I will be making the ship move, able to evade and possibly adding it to the random spawn rotation.



No comments:
Post a Comment