In this series I will be discussing the process of how I made my first mobile application, Dr. Dino, giving you tips, tricks, and tutorials on how you can get started with game development.
If you want to check out the first game I ever created, click the button below:
In this post, we will discuss how to destroy an object on collision.
To destroy an object on collision within the using ty software, you have to use some form of the void OnCollisionEnter method. For 2D games you need the void OnCollisionEnter2D() method and the void OnCollisionEnter() method for 3D games.
Both of these methods will activate when the object that the script is attached to has a collider and collides with an object. When the methods are activated, the Destroy function activates. When the Destroy(this.gameObject) function is activated, the object that this script is attached to will be destroyed.
See the sample code to destroy objects on collision below.
To destroy an object on collision within the using ty software, you have to use some form of the void OnCollisionEnter method. For 2D games you need the void OnCollisionEnter2D() method and the void OnCollisionEnter() method for 3D games.
Both of these methods will activate when the object that the script is attached to has a collider and collides with an object. When the methods are activated, the Destroy function activates. When the Destroy(collision.gameObject) function is activated, the object that collides with the object that this script is attached to will be destroyed.
See the sample code to destroy objects on collision below.
what is this series about In this series I will be discussing the process of how I made my first mobile application, Dr. Dino, giving you tips, tricks, and tutorials on how you can get started with game development. If you want to check out the first game I ever created, click the button below:…
what is this series about In this series I will be discussing the process of how I made my first mobile application, Dr. Dino, giving you tips, tricks, and tutorials on how you can get started with game development. If you want to check out the first game I ever created, click the button below:…
What is this series about In this series I will be discussing the process of how I made my first mobile application, Dr. Dino, giving you tips, tricks, and tutorials on how you can get started with game development. If you want to check out the first game I ever created, click the button below:…
What is this series about In this series I will be discussing the process of how I made my first mobile application, Dr. Dino, giving you tips, tricks, and tutorials on how you can get started with game development. If you want to check out the first game I ever created, click the button below:…
what is this series about In this series I will be discussing the process of how I made my first mobile application, Dr. Dino, giving you tips, tricks, and tutorials on how you can get started with game development. If you want to check out the first game I ever created, click the button below:…
keep it simple If your reading this post, then you have probably though about some game that you wanted to build without worrying about the fine details and required effort to create a game like Fortnite, Minecraft, or Call of Duty. And, after realizing the work required, you eventually give up, thinking that you could…