invisible partiles removal error

Updated on January 3, 2018 in [A] Brackeys Courses
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
0 on January 3, 2018

Hello i am trying to make 2D game and i use brackeys 2D game totorials everything was ok till this point where on video 13 at the end it shown what to change in code in order to destroy invisible particles from game and unity shows this error: 

Assets/GameMaster.cs(28,90): error CS0039: Cannot convert type `UnityEngine.Transform’ to `UnityEngine.GameObject’ via a built-in conversion

this is code the line error is pointing to. 

  GameObject clone = Instantiate (spawnPrefab, spawnPoint.position, spawnPoint.rotation) as GameObject; 

i did try to change GameObject and as GameObject changed to transform but it givs error that transform can not be destroyed.

please help me to solve thi problem.

thank you

  • Liked by