Jump to content

createcube offset from model


Rick
 Share

Recommended Posts

I have a model just like the lights. Inside the lua script I create a cube and make it's parent the model. I set the position of the cube to the position of the model but it's offset from it. Before when I was using LE function like EntityPosition() my model would be in the center of the cube, when when I switched to :SetPosition() it offset it.

 

local object=self.super:CreateObject(model)
object.cube = CreateCube()			-- make the cube and make the object it's parent

object.cube:SetPosition(object.model:GetPosition(1), 1)

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...