Legend of Targeting

Just do what Zelda does, dummy!

I would love to implement a system like that, but I’m not sure how it would work…

Well I haven’t looked into it myself because I don’t consider it a priority over following the rest of the course, but how I would go about it is script my shooting range (the big red sphere around your character) to, on console, detect for enemies and lock onto them if an enemy is within range AND you’re holding down L (or something.) Then, you can store that target and every time you attack, you program it to be directed at your target (eg. using Vector3.RotateTowards and setting the y of newDir to 0).

If you REALLY wanna go nuts with this and do all the cool camera stuff Zelda is doing, I suggest you go out on your own to learn about CineMachine. It is easily the best way, but it’s also quite complicated so set a day or 2 aside watching tutorials and fooling around. I suggest starting here, as the Unity Tutorials involve Timelines and if you’ve never worked with those before then there’s ANOTHER thing you need to learn! (Happened to me.)

1 Like

Privacy & Terms