On the devforum, I see that programs typically use something like this:
function CameraModule:LockMouse()
if self.activeCameraController then
local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
self.activeCameraController:SetIsMouseLocked(true)
self.activeCameraController:SetMouseLockOffset(mouseLockOffset*3)
end
end
--This is just an example of someone using the 'self' thing.
If you see this, there is a thing called self. What is self, and what are the practical uses of using self in functions like this?
Any help is appreciated!

1 comment
Search Results Featured snippet from the web Now to answer your question, we use self as a way to access the previous argument called in the function, without passing the argument explicitly. self is notably used in Object Oriented Programming Implementation in Lua.