Hello
First off let me start by saying I am new to Unity. I’m using the free version but the reason why I am using it is so I can make a game for my Oculus Rift. I will soon start using my trial of pro after this problem is fixed. I import a model of Ronal McDonald into Unity using a .dae file from Sketchup. It imports and I can use it as a collidable asset. But, I want it to be like Slender. I will post the code below. But, when I add the First Person Controller to be the Target and apply the code (basically use it) it disappears from the game. I can still see it when I edit the game. I think it is still there because I die randomly, so I assume it is just invisible. Help? Solutions? Alternative code?
Thanks a million
Images:
Slender AI Code (which works for second Slender model that I got from Sketchup):
using UnityEngine;
using System.Collections;
public class enemyai1 : MonoBehaviour {
public Transform target;
public int moveSpeed;
public int turnSpeed;
void Start () {
target = GameObject.FindGameObjectWithTag(“Player”).transform;
}
void Update () {
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(target.position - transform.position), turnSpeed * Time.deltaTime);
if(Vector3.Distance(transform.position, target.position) > 1) {
transform.position += transform.forward * moveSpeed * Time.deltaTime;
}
if(Vector3.Distance(transform.position, target.position) < 1) {
Application.LoadLevel(1);
}
}
}
EDIT: I just found out it flies in like Superman. This is really weird. I have a second Slender guy but as far as I can tell he does not affect Ronald at all. See the images above to see the flying thing.