- Home /
Question by
Skyline Studios · Sep 26, 2012 at 07:06 PM ·
triggerneeda
How Do I Move A Ghost On Trigger
Hi I Am Making A Game Called House (Horror Game Similar To Paranormal) And All I Want To Do Is Make My Ghost Fly Across The Screen (Not An Animation, Im Using The Constant Force.) On Trigger Please Help I Am New To Unity
Comment
Please, make a clear question. The name of your game, for example, is useless information while what you really need is missing.
Answer by NewDeveloper · Sep 26, 2012 at 09:12 PM
If you are a beginner, then first put CharacterController on thi Ghost. After that just use this script: (JS)
//script Move.js
var movePos : Vector3;
var controller : CharcterController;
function Update () {
controller.move (movePos * Time.deltaTime);
}
and put another script with GetComponent
var script : Move;
function Start () {
Move = GetComponent(Move);
Move.enabled = false;
}
function OnTriggerEnter (other:Collider) {
if (Collider.tag == "something") {
Move.enabled = true;
}
}