Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

error CS1502: The best overloaded method match for `UnityEngine.Vector3.Distance(UnityEngine.Vector3, UnityEngine.Vector3)' has some invalid arguments

$
0
0
I got two of the same errors , I trying to make my enemy ai follow the player . I capitalize the t on transform and I get more errors here is my code : using UnityEngine; using System.Collections; public class Enemyai : MonoBehaviour { public Transform player; static Animator anim; void Start () { anim = GetComponent (); } void Update () { if (Vector3.Distance(player.position, this.transform) < 10) { Vector3 direction = player.position - this.transform.position; direction.y = 0; this.transform.rotation = Quaternion.Slerp (this.transform.rotation,Quaternion.LookRotation(direction), 0.1f); } } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>