Jump to content

Attach Script to entity created at runtime

Recommended Posts

Is it possible to attach a script to an entity created with code?

My searching suggests that there was a function called Entity:SetScript() but I can't find it when searching the documentation (and I am not at the computer with LeadWerks to test it right now).



Ok it looks like Entity:SetScript() does exist but isn't documented. Some documentation would be nice, I still need to experiment to see whether Script:Start() is called automatically or not after attaching it.

Share this post

Link to post

Script:Start is called when using Entity:SetScript :)


I had troubles finding this at first too. There are quite some functions which aren't documented. Quite a pity

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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