code error how i fix this?,how i fix this coding error?
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class enimy : MonoBehaviour {
public float MoveSpeed;
public float RotateSpeed;
public float MinDistance;
public float MaxDistance;
public GameObject Player;
// Use this for initialization
void Start () {
Player = GameObject.FindGameObjectWithTag ("Player");
}
// Update is called once per frame
void Update () {
float distance = Vector3.Distance(transform.position, Player.transform.position);
if( distance> MinDistance && distance < MaxDistance && Player != null)(
transform.position += transform.forward * MoveSpeed * Time.deltaTime;//to move the spider
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(Player.transform.position - transform.position), RotateSpeed);
}
}
Comment
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class enimy : $$anonymous$$onoBehaviour {
public float $$anonymous$$oveSpeed;
public float RotateSpeed;
public float $$anonymous$$inDistance;
public float $$anonymous$$axDistance;
public GameObject Player;
// Use this for initialization
void Start () {
Player = GameObject.FindGameObjectWithTag ("Player");
}
// Update is called once per frame
void Update () {
float distance = Vector3.Distance(transform.position, Player.transform.position);
if( distance> $$anonymous$$inDistance && distance < $$anonymous$$axDistance && Player != null)(
transform.position += transform.forward * $$anonymous$$oveSpeed * Time.deltaTime;//to move the spider
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(Player.transform.position - transform.position), RotateSpeed);
}
}
the error is ther transform.position += transform.forward $$anonymous$$oveSpeed Time.deltaTime;//to move the spider
Your answer
Follow this Question
Related Questions
Update and Get PlayerPrefs during runtime? 0 Answers
Reversing the process 0 Answers
My Raycast won't work at all ?? (C# Windows) 1 Answer
hi, please help with camera control on android phone 0 Answers