Unity Logo

Rotate an object towards the mouse position [2D]

In this article I’ll briefly explain how you can rotate an object, using Unity, in order for it to “look” at the mouse position. TL;DR Here’s the code snippet which will make the player transform point towards the mouse position. Please read below if you’re interested in how this works. Explanation Let’s start with the …

Rotate an object towards the mouse position [2D] Read More »