Vertical Space Shooter in Unity 2D - Tutorial for Beginners
How do you make a vertical space shooter in Unity? First of all, you need to rotate your player and move it to the bottom. and add a canvas that will have a controller for your player. It will be an on-screen joystick that will be transparent, so make sure to modify the slider of the color tab. And make sure to set the anchor point to make it responsive. Now add a rigidbody2D and add a C# script. Since this tutorial uses New Input System, it requires these components: InputSystem and InputAction. In this project, the input action is called Move. There is a Click input layer that contains all these input actions. The input requires void OnEnable() and OnDisable() that requires the introduction to the input action: inputSystem.click.move.performed += OnMove, make sure to set + in OnEnable and – in OnDisable. These two lines are also important: inputSystem.Enable() and inputSystem.Disable(); This tutorial is useful for fixing the problem with screen sizes, where minimum and maximum X values will be updated according to screen size. It uses ScreenToWorldPoint to adjust the X values to the screen width and height. Although the enemies have already been added in the previous tutorial, this tutorial does not need any explanation for the enemy script, the only thing is that the xMin and xMax values use the same code as from the script for enemies. Support the Creator of Kozmobot on the social networks! CHECK OUT MY WEBSITE: http://kozmobot.com INSTAGRAM: https://www.instagram.com/kozmobot.channel TIKTOK: https://www.tiktok.com/@kozmobot.channel
Download
0 formatsNo download links available.