How to make a bullet in a top down arcade-styled game?
Hello! I am >18 and I like spending some time in Unity!
So this is my first game and i want to create a game based on the old arcade games where you are a spaceship and you try to make a highscore by killing alien spaceships. I hope you understand :P
I want a script where if i press "X", it will shoot a bullet (Which is a sprite) and on contact with the enemy it will kill him. I only want to know how to make the bullet shoot forward (Up in the Y axis)
Here is a quick script i made: (It may be completely wrong)
var Bullet1 : Sprite;
function Update()
{
if (GetButtonDown("Shoot1") {
var ShootSound1 : AudioSource = GetComponent.<AudioSource>();
ShootSound1.Play;
//Here i want to tell Unity to spawn the Bullet1 sprite and move it only up, on the Y axis in a certain speed. let's say 10
}
}
@PaulDabest Have you had a look at the spaceshooter tutorial?
I could use some help than just send me a link which doesnt have what i want...
Your answer
Follow this Question
Related Questions
Unet: Bullets only spawn only spawn on host, visible only on host 0 Answers
Bullet goes sideways when the player gets hit 1 Answer
Instantiating object at wrong location, Unity bug? 0 Answers
How to make health and damage script function correctly? 3 Answers
How do I define the direction and speed of a projectile separately? (JS) 0 Answers