Binding of Isaac shooting - Unity 2019 Beginner Tutorial

preview_player
Показать описание
This tutorial goes over how to create a binding of isaac styled shooting mechanic inside of unity! If you enjoyed, be sure to leave a like and subscribe!

Рекомендации по теме
Комментарии
Автор

I like the way you set up the ternary operator for the bullet velocities/directions, the way I always do it is keeping track of the players direction by having a bunch of variables but this is much more efficient!

GamingDco
Автор

Guys :quick tip CTRL D and you duplicate a line downwards

seraphimsarecoool
Автор

Nice tutorial mate!
May i know what is the name of the color scheme/theme you are using?

xsar
Автор

If he says OK one more time im going to go

hydra
Автор

Good The Tutorial! But on 10:57 Showed a Bunch Of Errors Because i Din't Put ) ; } in The Shoot if, please help

Abreuhideme
Автор

i have a problem, even if i dont press anithing it is continously keep firing, how di i fix that i try everything

leanforever
Автор

Does anyone know how to edit this code to remove the diagonal shooting?
So it only shoots up, down, left right
Any help would be greatly appreciated!

wi-chung
Автор

I know this video is very old, but is there any chance I could get some help? When shooting my bullet they linger in place If not holding down the shoot key.

ethansage
Автор

I had to update to latest to 2019.4 to see the project settings like you see in the video. just a fyi

rtkiiiprod
Автор

Thanks for the video. I have a question do.... I have animation on my char and like to make it look the way I shoot do you know any videos or unity pages where I can get some tips.

YessVideos
Автор

now all he needs to do is tell us how to set our projectiles to have animations and face the direction that they're being shot in!

SwampyWitch
Автор

Man, the autocomplete is useful but it can really mess ya up sometimes. It turned the DeathDelay function into "IEnumerable" instead of "IEnumerator", and it took forever for me to figure out why I got an error in the StartCoroutine.

southhill
Автор

Hi I ran into another small problem when making the final code of the bullet controller. It says that there are no monoBehaviours scripts in the file/ does not match the file name even though the script and the code are both listed as ‘BulletController’. I’m not sure what to do now

theoddman
Автор

Hey! This has really helped me out thanks a bunch, but i hab one small


When i fire the bullet, it fires normally, but then it eventually deletes the original bullet prefab gameObject and I am left with no bullets to shoot...

AStixMatism
Автор

Hello, i have a problem with my bullets, i think that it is with the time.time variable, but after some seconds it takes a while for the player to shoot a bullet, and if a put less than 1 second in fire delay it shots a lot of them, i am doing something wrong?

xavierarana
Автор

how can i convert this script to 3d project?

thebigs
Автор

5:18 how do you get that double line or?

doctormgw
Автор

ALSO "||" this is for or i still can't find a key to place these with my hu keyboard :C

seraphimsarecoool
Автор

my bullet spawns like 1000 times lol idk what to do

rynbloom
Автор

I know this tutorial is old but when I press the arrow keys the bullet does not duplicate

Here's my code!

using UnityEngine;

public class Player : MonoBehaviour
{

public float speed;
Rigidbody2D rigidbody;
public GameObject bulletPrefab;
public float bulletspeed;
public float bulletdelay;
private float lastFire;

void Start()
{
rigidbody = GetComponent<Rigidbody2D>();
}

void FixedUpdate()
{
float horizontal = Input.GetAxis("Horizontal");
float vertical = Input.GetAxis("Vertical");

float shootHorizontal = Input.GetAxis("Shoot Sideways");
float shootVertical = Input.GetAxis("Shoot Up");

if((shootHorizontal != 0 || shootVertical != 0) && Time.time > lastFire + bulletdelay)
{
Shoot(shootHorizontal, shootVertical);
lastFire = Time.time;
}

rigidbody.velocity = new Vector2(horizontal * speed, vertical * speed);
}

void Shoot(float x, float y)
{
GameObject bullet = Instantiate(bulletPrefab, transform.position, transform.rotation) as GameObject;
= 0;
= new Vector3(
(x < 0) ? Mathf.Floor(x) * bulletspeed : Mathf.Ceil(x) * bulletspeed,
(y < 0) ? Mathf.Floor(y) * bulletspeed : Mathf.Ceil(y) * bulletspeed,
0
);
}
}

LeonTVRyt