I tried to use other.CompareTag but just received an error saying that other is an unknown identifier? can anyone help me?
#pragma strict
var Slow = 0.5;
function Start () {
}
function Update () {
}
function OnTriggerStay(Bullet : Collider)
{ //the "other" below this text is the one cauisng trouble it seems
if (other.CompareTag ("Bullet"))
{
Time.timeScale = Slow;
Time.fixedDeltaTime = 0.02 * Time.timeScale;
}
}
function OnTriggerExit(Bullet : Collider)
{ //the "other" below this text is the one cauisng trouble it seems
if(other.CompareTag ("Bullet"))
{
Time.timeScale = 1;
Time.fixedDeltaTime = 0.02 * Time.timeScale;
}
}
[32218-inspector+1.png|32218]
Please post your actual, complete code.
– tanoshimii have posted the code now
– Indiana_MogensYes of course you are getting the error cause you didn't define the variable 'other'. You defined the Collider as 'Bullet'.
– Subhajit-Nathsubhajit, try reading the comment i placed. it says that the other is the one causing trouble, the bullet define thingies had been there without causing trouble. but as soon as i added the "other" at the compare tag, it began causing trouble
– Indiana_MogensThat's what I said. You never defined 'other'. Try following tanoshimi's answer. We both are basically saying the same thing. :)
– Subhajit-Nath