Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am creating a project in Unity using C# and have to complete the following for spawning random cacti. Please help me with the coding

I am creating a project in Unity using C# and have to complete the following for spawning random cacti. Please help me with the coding for this, I have no experience and could use the help.

image text in transcribed

Spawning: A random cactus character prefab should be spawned every 3 seconds out of a pool of 2 prefabs in the project (Cactus1 and Cactus2). The spawn position should be selected randomly out of a pool of 4. The spawn positions can be found under the Environment GameObject in the Hierarchy (i.e., Enemy SpawnPos1 to EnemySpawnPos4). Each spawned cactus should be rotated towards the tank. Running: The cacti characters should run at 20 meters per second towards the tank. Hit: Whenever a rocket hits a cactus, the HitEffect particle prefab should be played once at the position of the rocket, and both the rocket and the cactus should be destroyed. Tank Damage: Whenever a cactus hits the tank (meaning that the user could not hit the cactus), the DamageEffect particle prefab should be played once at the position of the cactus with an offset of 3 in y-axis (for better visibility), and the cactus should be destroyed. Spawning: A random cactus character prefab should be spawned every 3 seconds out of a pool of 2 prefabs in the project (Cactus1 and Cactus2). The spawn position should be selected randomly out of a pool of 4. The spawn positions can be found under the Environment GameObject in the Hierarchy (i.e., Enemy SpawnPos1 to EnemySpawnPos4). Each spawned cactus should be rotated towards the tank. Running: The cacti characters should run at 20 meters per second towards the tank. Hit: Whenever a rocket hits a cactus, the HitEffect particle prefab should be played once at the position of the rocket, and both the rocket and the cactus should be destroyed. Tank Damage: Whenever a cactus hits the tank (meaning that the user could not hit the cactus), the DamageEffect particle prefab should be played once at the position of the cactus with an offset of 3 in y-axis (for better visibility), and the cactus should be destroyed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions

Question

3. Is there opportunity to improve current circumstances? How so?

Answered: 1 week ago

Question

2. How will you handle the situation?

Answered: 1 week ago