Point and Shoot / Turret Tutorial - Unity

  Рет қаралды 10,236

Tarodev

Tarodev

Күн бұрын

DISCLAIMER:
Replace the line:
transform.up = Vector3.MoveTowards(transform.up, mousePosition, _rotationSpeed * Time.deltaTime);
with:
var dir = mousePosition - transform.position;
transform.up = Vector3.MoveTowards(transform.up, dir, _rotationSpeed * Time.deltaTime);
Learn how you can rotate your turret towards your mouse cursor (or anything you desire), fire projectiles, and kill enemies.
Art Assets: imgur.com/a/W47V2UD
Script: bit.ly/3l3LyGr
=========
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev
MORE TUTORIALS:
/ tarodev
0:00 Intro
0:08 Setup the Turret
0:29 Following the mouse pointer
1:49 Rotation smoothing
3:12 Making the projectile
5:38 Shooting the projectile

Пікірлер: 11
@durvids474
@durvids474 3 жыл бұрын
Great tutorial, thank you! Looking forward to more!
@fess1024
@fess1024 3 жыл бұрын
Thank you friend!
@walney2008
@walney2008 2 жыл бұрын
very good tutorial, how spawn enemys any locals ?
@mitchellcaldwell6745
@mitchellcaldwell6745 Жыл бұрын
How would you set this turret up for a 3D project? I'm having trouble getting it to work?
@noobcraft5712
@noobcraft5712 3 жыл бұрын
Gooooooood
@warget
@warget 2 жыл бұрын
Q: Why don't you spawn the bullet with a rotation? I am thinking that the rotation can take into consideration the direction - this way, you don't need Init() on bullet, but just update, and apply force forward
@SharathThe1
@SharathThe1 2 жыл бұрын
Hey, thanks for these videos! Could you help with two question about this? 1. why does this work only if your camera is set to Orthographic mode? 2. why did you ask us to replace a line with ```var dir = mousePosition - transform.position; transform.up = Vector3.MoveTowards(transform.up, dir, _rotationSpeed * Time.deltaTime);``` in the description? it actually does a 360 rotation when your mouse is at the bottom
@abisInc9277
@abisInc9277 Жыл бұрын
Try using, dir.z = 0; instead of mousePosition.z = 0;
@dreadge
@dreadge 2 жыл бұрын
how would i make the bullet point the same way the cannon is aiming the moment it was fired? ( i have a longer bullet )
@lawrencemiller2642
@lawrencemiller2642 Жыл бұрын
help i have the same problem :D
@wesleyfortin6251
@wesleyfortin6251 7 ай бұрын
set the bullets front transform to the same value of the turret (from mouse pos)
2D follow AI with Unity - [Tutorial]
6:34
Tarodev
Рет қаралды 7 М.
2D Top Down Shooting POINT & CLICK Unity Tutorial
13:55
Final increíble 😱
00:39
Juan De Dios Pantoja 2
Рет қаралды 15 МЛН
100❤️ #shorts #construction #mizumayuuki
00:18
MY💝No War🤝
Рет қаралды 20 МЛН
UFC 302 : Махачев VS Порье
02:54
Setanta Sports UFC
Рет қаралды 1,2 МЛН
8 DEVS Make a GAME without COMMUNICATING!
13:21
Blackthornprod
Рет қаралды 965 М.
2D Enemy Shooting Unity Tutorial
12:52
MoreBBlakeyyy
Рет қаралды 51 М.
How to make AI Turret Bots in UNITY - 2D
14:59
The Game Guy
Рет қаралды 26 М.
TOUCH CONTROLS in Unity!
16:09
Brackeys
Рет қаралды 1,3 МЛН
Unity Tilemaps - Hex, rectangle, isometric + rule tiles
18:38
5 VS 5 DEVS - Which TEAM Makes the BEST GAME without COMMUNICATING?
17:01
Animated Cursors in Unity!
16:59
Code Monkey
Рет қаралды 25 М.
2D Shooting in Unity (Tutorial)
21:12
Brackeys
Рет қаралды 1,2 МЛН
Minecraft Has Lost Its Identity
11:25
Daiazal
Рет қаралды 769 М.