Hello, i’m trying to do a code to player look at mouse, but i’m a beginner and don’t know how to do it exatly, here is my code:
using UnityEngine;
using System.Collections;
public class PlayerBehaviour : MonoBehaviour {
public Transform target;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.LookAt(target);
}
}
I need to put mouse in target, but how? Or i need to do other code? Somebody can save me with that? I’m using C#, thanks =(
And sorry for my bad english