Hi guys I need help!
I’m making a Slender Type game with Alma from the game Fear. I’m trying to make that it appears in front of you when you collide with a trigger and then dissapears.
The problem is that appears there from the beggining and then the trigger is useless I don’t know why.
This is the script:
var almaTrigger : GameObject;
var Alma : GameObject;
function Start () {
Alma.SetActive (false);
}
function OnTriggerEnter () {
Alma.SetActive (true);
}
function OnTriggerExit () {
almaTrigger.SetActive (false);
Alma.SetActive (false);
}
almaTrigger is the trigger ingame and Alma it’s the character (object/slender)
Thank You guys!
Well, where’s the suprise? In OnTriggerExit you deactivate the trigger.
bruga94
December 5, 2013, 11:34am
3
I don’t know what do you mean. I started using Unity few days ago.
I don’t see the error in the script.
Ian094
December 5, 2013, 3:21pm
4
Try doing something similar to this :
var Alma : Transform;
var AlmaTrigger : Transform;
function Start(){
Alma.active = false;
}
function OnTriggerEnter(other : Collider){
if(other.gameObject.name =="AlmaTrigger"){
Alma.active = true;
}
}
function OnTriggerExit(other : Collider){
if(other.gameObject.name =="AlmaTrigger"){
Alma.active = false;
AlmaTrigger.active = false;
}
}
Name your trigger “AlmaTrigger” (Without the quotes).
It goes the same.
And it appears me this long error:
MissingMethodException: Method not found: ‘CompilerGenerated.SoundScript_OnTriggerEnter$callable0$6_1 .audio’.
Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.ProduceExtensionDispatcher ()
Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.Create ()
Boo.Lang.Runtime.RuntimeServices.DoCreateMethodDispatcher (System.Object target, System.Type targetType, System.String name, System.Object[ ] args)
Boo.Lang.Runtime.RuntimeServices.CreateMethodDispatcher (System.Object target, System.String name, System.Object[ ] args)
Boo.Lang.Runtime.RuntimeServices+c__AnonStorey12.<>m__6 ()
Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[ ] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[ ] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.Invoke (System.Object target, System.String name, System.Object[ ] args)
UnityScript.Lang.UnityRuntimeServices.Invoke (System.Object target, System.String name, System.Object[ ] args, System.Type scriptB
I’m so desesperate
Ian094
December 6, 2013, 4:43pm
6
Are you using Javascript?