Make a 3D Object look like hes facing a point in an 2D space
The first thing you will notice is the complicated and confusing title. So let me explain that.
Im trying to make an 2D game in an 3D space using Unity. And im using a 3D Character as an Player. This looks like that :
As you can see the Background ( A Google map ) is two dimensional. While the Player is a 3D Object laying on the ground ( It just Looks like hes Standing ).
Thats working fine so far. But i want that the 3D Character Looks like hes facing a tapped Point on the Background map.
For example :
The black circle represents the tapped Position. So i have totally no clue if theres a way to do that, or even if its possible to do that.
I tried the following code, but that only rotates my character on an different axis :
Vector3 targetDir = tapped.position - transform.position;
float step = speed * Time.deltaTime;
Vector3 newDir = Vector3.RotateTowards(transform.forward, targetDir, step, 0.0F);
transform.rotation = Quaternion.LookRotation(newDir);
Is there even a way to achieve that ? Im currently out of ideas... I would be very glad for any help i can get !
Your answer
Follow this Question
Related Questions
Having a couple of problems regarding 2D Movement. 1 Answer
Moving an object in a curve along the z-axis 0 Answers
Maximum number of hexagons in one map? 1 Answer
How do i Gizmos.drawLines in an order?? 2 Answers
How do I Instantiate a prefab at the x axis position of where the UI button was clicked 1 Answer