Unity Rotate Towards Target and Shoot - Part 2
ExpanseVR ExpanseVR
2.26K subscribers
1,517 views
26

 Published On Oct 5, 2021

Welcome to the second part of this brand-new series on my channel.

A big problem with most Unity Tutorials, including some on this channel, is that you are given the answers. The biggest part of being a software engineer is solving problems yourself.

This unique series of Unity challenges will try to fill that gap by giving small problems to be solved, and showing you how I would go about solving them. These will be set up as two-part videos. A - the tasks to be solved and B - the answers.

In part A, you are giving the task to try and figure out how to rotate an object towards a target and shoot a projectile at it. I suggest checking out that video first here:

   • Unity Rotate Towards Object and Shoot...  

In this second part, I will show you how I would rotate the turret of a tank towards an object, add some nice FX to it and shoot a missile at the target.

If you get stuck or better yet want to show off your results, make sure to jump onto the Discord Channel and share a video or screenshot of your results:

  / discord  

And if you are looking for an easy way to share to Discord, I recommend the free app ShareX:

https://getsharex.com/

If you are looking for some tips, many of my HowTo videos cover some aspects of what is in this challenge. So make sure to check them out too:

   • How To Series  

Timecode
0:00 - Intro
0:08 - The purpose of this Unity tutorial
1:33 - Recap of the challenge
2:25 - How to fix game object rotating wrong in Unity
5:08 - Rotating to face target in Unity
9:57 - Refactoring your code in Unity
11:55 - Only rotate on the Y-Axis in Unity
16:15 - Player UI
20:00 - Firing a projectile in Unity
21:05 - Fix clipping in Unity Scene View
34:45 - Object pooling in Unity
35:11 - Tutorial wrap up

show more

Share/Embed