Jump to content

value is nil


Rick
 Share

Recommended Posts

What am I missing here? I load the mesh, but when I try to SetPosition() it says object.characterModel is nil. So the mesh isn't getting loaded, but the Notify I have shows the correct filename and the model is under the Model directory on the LE SDK. Is there a typo I'm not seeing?

 

function object:SetKey(key,value)
	if key=="model" then
		local pos = self.model:GetPosition()
		object.characterModel = LoadMesh("abstract::"..value)
		Notify("abstract::"..value)
		object.characterModel:SetPosition(Vec3(pos.x, pos.y, pos.z))
	else
		return self.super:SetKey(key,value)
	end
	return 1
end

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...