Jump to content

Adding a component manually does not trigger the Start method.


Recommended Posts

Posted
Cube = {}


function Cube:Start()
   Print("Start") -- Not Run.
end



function Cube:Update()
   self.entity:Turn(0,1,0)
  
end

The `update` method runs without any problems; I’m not sure whether `collision` or `load` are executed.


On another aspect of the project. 

 

local cubos = self._world:GetEntities("name", "==", "MiCubo")

    for _, entity in ipairs(cubos) do
        local cubo = Brush(entity)

        if cubo then
          cubo:AddComponent(Cube)
        
        end
    end


Anything I put in the ‘update’ section works.

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.

×
×
  • Create New...