Open anedumgottil opened 7 years ago
Turret class in C# code should be assigned to the prefab as a Script Component (drag to it) and Inherit from StationaryEntity class, once this is achieved I can spawn them in with the sample map generation code that currently exists in the MapGenerator, so work on getting this packaged up so we can spawn em in whenever we like
They will be checking to see if each one of us is using AI constructs in the code, so it would be great if you could try to add some Finite State Machine type functionality to the turret, which affects how it decides to shoot the player
remember you can always get the player's position by calling Player.getInstance() to get the player class, then getting the .gameObject property of it (since it's a monobehaviour) and getting the transform of one of the children objects (like the headset for example) to retrieve the player's current world coordinates to aim at. Just google search how to get a child gameobject of a transform and there'll be like 100 links explaining it, and make sure you do a raycast to see if you can shoot the player unobstructed and make sure they're in some kind of configurable public variable range first
good luck homes
The turret needs its' targetting script to be complete by this Thursday. It needs to rotate it's head to track the player, and when the player gets within a distance, sends a raycast to see if it can hit the player, and if it can, fires.
The firing should create a bullet at the end of the barrel and create a Particle System to satisfy one of our physics requirements and create a sick cloud of dust and fiery smoke from it firing.
it needs to be a stationary entity so I can assign it to GridSpaces.
Description: Similar to the Door, the turret will be a SINGLE gameobject with all of it’s parts (barrel, body, etc) stored as children to that gameobject, and all of it’s scripts stored as a component to that gameobject. The turret will be loaded in via MapGenerator at runtime and stored in a variable within the GridSpace class automatically.
Graphical: