I stared at it, hoping it would hit me but it’s just not sinking in; in this function from the Pickup.js script in the 3DPlatformTutorial (page 45-46):
function OnTriggerEnter (col : Collider)
{
if (mover mover.enabled) return;
var playerStatus : ThirdPersonStatus = col.GetComponent(ThirdPersonStatus);
//* Make sure we are running into a player
//* prevent picking up the trigger twice, because destruction
// might be delayed until the animation has finished
if (used || playerStatus == null)
return;
if (!ApplyPickup (playerStatus))
return;
used = true;
…what exactly am I assigning to this variable?
var playerStatus : ThirdPersonStatus = col.GetComponent(ThirdPersonStatus);
I have the ThirdPersonStatus.js script open, and I’m still not making the connection.
This leaves me equally confused about what is happening here:
function ApplyPickup (playerStatus : ThirdPersonStatus)
…which is located right above the OnTriggerEnter function in the same script.
Rest assured while I may be new to coding, I’m not new to ‘programming’, but my experience is more conceptual/theory. I come from a Virtools background so my actual coding knowledge needs to ‘robustification’, so please be gentle.
I AM understanding an awful lot, dare I say most of what I’ve read (which includes nearly everything from tuts, to videos, to forum posts, to the wiki, and every doc I could find) but there are instances like these that I’m bound to be tripped up by.
Otherwise so far so good and I’m very impressed with Unity (and enjoying the experience to boot, as I’m not only new to Unity, I’m new to Mac’s!)
Thanks guys!