Hey guys and girls,
Simply enough I’m having a little trouble with this part of a script, as simply enough I don’t quite understand javascript just yet. What i’m trying to do is OnTriggerEnter I want the gravity applied to this object via its rigidbody to be tunred on… however it’s not quite there.
function OnTriggerEnter(otherObject: Collider){
if(otherObject.gameObject.tag == "switch1"){
var block1 = GameObject.FindWithTag ("block1");
block1.attachedRigidbody.useGravity = true;
}
}
Any ideas would be lovely.
Thanks!