Point and Shoot / Turret Tutorial - Unity
Chapters
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: https://imgur.com/a/W47V2UD
Script: https://bit.ly/3l3LyGr
=========
❤️ Become a Tarobro on Patreon: https://www.patreon.com/tarodev
=========
🔔 SUBSCRIBE: https://bit.ly/3eqG1Z6
🗨️ DISCORD: https://discord.gg/tarodev
✅ MORE TUTORIALS: https://www.youtube.com/tarodev
MORE TUTORIALS:
https://www.youtube.com/c/Tarodev
Education
#tarodev
#2D LookAt
#unity
#tutorial
#turret
#follow mouse
#mouse position
#point and shoot
#face mouse
#unity point and shoot
#unity shooting 2d
#unity shoot bullet script
#unity shoot projectile in direction
#unity gun shoot script c#
#unity fire projectile at target
#unity shoot towards mouse
#unity 2d topdown shooting
#unity c#
#unity tutorial
#unity programming
#LookAt