Thanks for the reply
Question:
I understand it is a argument that I’m passing to the function.
but, it in a way, dosen’t (myTrigger) becomes a temporary variable because it now is = to “box” the collider that has been hit,
yes? - or no?
-am I over thinking it?
thanks for any help.
Yeah, you can think of “myTrigger” being a special temporary variable that’s declared for the scope of that method. The only difference is it is assigned a value by whatever calls that method.
If you want to create other variables for use in that method, but not expose them as an input parameter for the method, just declare them on their own line below the method signature:
function OnTriggerEnter (myTrigger : Collider)
{
var someOtherVariable : String = "asdf";
var anotherOne : int = 5;
}