TOP DOWN SHOOTING in Unity

preview_player
Показать описание
Let's have a look at the easiest and best way to make top down shooting in Unity!

Jason no longer offers the course mentioned in the video.

····················································································

········································­­·······································­·­····

► All content by Brackeys is 100% free. We believe that education should be available for everyone.

········································­­·······································­·­····

♪ "ES_Dress Code_Black - oomiee" by Epidemic Sound
Рекомендации по теме
Комментарии
Автор

Whoah hello there handsome are you new around here??

Danidev
Автор

IF YOUR CHARACTER IS ALWAYS LOOKING AT THE CENTER OF THE SCREEN (or some other fixed point) and not rotating towards your mouse cursor, change the camera to ORTHOGRAPHIC. By default the main camera seems to be set to PERSPECTIVE which adds a Z component into the mix which isn't handled by the code shown in this video.

bloodyblue
Автор

There are rumors that those bullets that exited the screen without any collision are still flying around these days.

juschu
Автор

AHHHH YOUR HAIR!! I was like "ah neat they hired a new guy at Brackeys!"

sykoo
Автор

Brackeys is nice, easily understood, and his tutorials are great.

silentminecrafter
Автор

I love how genuinly excited Brackeys gets with something like a bullet shooting out.. he's probably written a similar script to that a million times but still acts like its the first time he has ever done it... ahhaaha love him

josephpizzati
Автор

i had an issue and i figured it out without Brackey i am truly evolving

bando
Автор

i grew up playing gta2 and hotline miami was one of those games that made me wanna be a game developer. top down shooters will always have a special place in my heart :)

Roundbeargames
Автор

Brackeys please make a video about clean code or solid solid principles :)

mehmedcavas
Автор

I think the reason Brackeys is more popular than other unity youtubers is that not only he makes great tutorials, he also explains the code so even a 5 year old could understand. Great job brackeys!

XtrminatR
Автор

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
public float moveSpeed = 5f;

public Rigidbody2D rb;
public Camera cam;

Vector2 movement;
Vector2 mousePos;

// Update is called once per frame
void Update()
{
movement.x =
movement.y =

mousePos =
}

private void FixedUpdate()
{
rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);

Vector2 lookDir = mousePos - rb.position;
float angle = Mathf.Atan2(lookDir.y, lookDir.x) * Mathf.Rad2Deg - 90f;
rb.rotation = angle;
}
}


this is for 2d movement
and for me so i can come back in the future

davidtimms
Автор

I miss a couple of brackeys episodes and suddenly he is jesus LOL

GoronTico
Автор

*_Thank you for tuning in at Brackeys_*

echelon
Автор

@9:23 you have to do -90f because for Unity the std 0 degree is to the right. and you later addForce to the up vector. if you use
rb.AddForce(firePoint.right) you dont have to do -90. But beware you have to rotate the sprite in the prefab also to point to the right.

burlydoe
Автор

this is the first thing i've been able to successfully get working on unity- thank you so much man.

NatGames
Автор

After bombing the recent GameJam I just signed up for Jason's course. I'm a little skeptical but if Brackeys recommends him then I'm all for it. Wish me luck everyone!

michaelwarwavesyn
Автор

i don't make 2D games, but i still end up learning tips and tricks from these videos that i can use. Thanks for another awesome, well explained video :)

Jalechah
Автор

You can solve the "need to offset by -90°" problem by having your sprites start pointing to the right rather than up. 0° in screen space points to the right rather than up/forwards like a compass.

orionsswords
Автор

Hi! I'm Brazilian, and, to love your channel, many things are not found for my language unfortunately, but you do it so calmly, and step by step you can understand it without knowing anything about English, just knowing a little of a language, the creation.

DiogoSilva-jsrn
Автор

This is so sad because he stopped making vids now

ayushsagar