var generator : Transform;
private var isActive : boolean = true;
var isNegative : boolean;
private var x = transform.position.x + 10;
private var z = transform.position.z + 10;
function OnTriggerEnter (other : Collider) {
//Create new biome
if(isActive == true isNegative == false){
Instantiate(generator, Vector3(x, 0, z), transform.rotation);
isActive = false;
}
}
I have this script on the trigger. Nothing happens when I walk through. Help please? Collisions always give me problems.
So my first thoughts are that isActive ( trigger is active ?) and isNegative may be essentially the same thing?
Anyhow, as long as you are getting to there great. If not, check via print(“”).
Now two things.
-
I use
If(other.tag == “objectTag”)
DoThis;
-
Make sure one of the objects is a rigidbody.
I dont want want one of them to have a rigidbody. They shouldnt need to. And I have no idea what your talking about in your first suggestion.
Can someone please just fix my code?
To clarify, isNegative won’t be used until later. isActive is so that the player cant set off the same trigger twice.
Not entirley sure but…
I think you should have
Something = instantiate();
Also i do believe one object in a teigger event, either the trigger or trigee need to have a rigidbody.
your wrong. it doesnt need to be a variable. I’m kinda stuck here
Ok.
Well good luck.
I would put prints in tho.
See if your trigger is actually registering.
Also, in the inspector… Did you set the trigger to be a trigger?
Edit: nevermind everything I wrote - I’d follow renman’s suggestions.