1
Fork 0
mirror of https://github.com/Steffo99/mission-failed.git synced 2024-12-04 22:04:17 +00:00

Removed wrong operation and cast

This commit is contained in:
Stefano Calabretti 2018-12-01 19:34:22 +01:00
parent 1315015b94
commit bf98e35f63

View file

@ -19,14 +19,11 @@ public class RotateTowardsMouse : MonoBehaviour
void Update() void Update()
{ {
//Trova la direzione tra il transform e il braccio //Trova la direzione tra il transform e il braccio
Vector2 screenPosition = Vector3 screenPosition =
Camera.main.WorldToScreenPoint(transform.position); Camera.main.WorldToScreenPoint(transform.position);
Vector2 direction = Vector3 lookDirection =
(Input.mousePosition - screenPosition) as Vector2; (Vector3)(Input.mousePosition - screenPosition);
Vector3 lookDirection =
new Vector3(direction.x, direction.y);
/* /*
* In alternativa provare direttamente con * In alternativa provare direttamente con