Corutine.wrap not sending argument to OOP functions

I am trying to use corutines to update my many npc in the game about ten times every frame but I can seem to be able to send arguments with corutine.wrap
here is some example code of what does looks like:

local Class = {}
Class.__index = Class

function Class.new()
	
	local newObject = {}
	setmetatable(newObject, Class)
	
	return newObject
	
end

function Class:Print(x)
	
	print(x)
	
end

local object = Class.new()
coroutine.wrap(object.Print)(69)
--Prints 'nil'

what i have tried so far:
coroutine.wrap(object.Print())(69) --nil

coroutine.wrap(object:Print(69)) --works but throws an error 
--missing argument #1 to 'wrap' (function expected)

coroutine.wrap(object:Print())(69) --nil
coroutine.resume(coroutine.create(object.Print), 69) --nil

1 Like

Not sure if this will help you figure it out as I don’t really use OOP but
Changing the : to a . in the function Class:Print(x) and the call will print the output.

coroutine.wrap(object.Print)(69) -- prints 69

1 Like

That’s because function Class:Print(x) is a method, pass in a empty table or nil:

coroutine.wrap(object.Print)(nil, 69)
or 
coroutine.wrap(object.Print)(object, 69)