Hiya,
I’m having an weird time with something here.
I’m trying to add a collision Sensor to an object.
I’ve created my ‘object’ and added physics to it and a ‘isSensor’ to it.
I’ve then created my collision function.
Simply put:
function StarSensor:collision (e)
if(e.phase == "began") then
audio.play(btnpress);
trackStars(self);
end
return true;
end
For some reason this one keeps telling me:
" attempt to index global ‘objSensor’ (a nil value) "
I’ve used other collision sensors in my level but I dunno why this ones not having it.
Get in there!
Is there a limit? (I’m at 3, ‘…:collision’ events so far)
Or are my eyes just missing something stupid?
(I’ve checked and re-checked loads!)
Thanks
PS: And while i’m here, is it okay that my collision functions, like above, don’t have ‘local’ in front of them, everything else does but if i do to those, they return errors. [import]uid: 91798 topic_id: 17253 reply_id: 317253[/import]
