Jump to content

Attach Script to entity created at runtime


whiterabbit
 Share

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

 

EDIT:

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.

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