Jump to content
Berken

Multiple scripts in an entity

Recommended Posts

I want to use multiple scripts in my character, but I don't want to change the FPS script. I hope this feature will be added in the future.

Leadwerks / Unity

oknM2Q.png 7N2Gbr.png

 

Thanks Josh.. :)

Share this post


Link to post

I experimented with both approaches during development, and I decided to use a single script system because it made the scripting a lot simpler.  With our system you can just check to see if a function exists and call it if it does:

if world:Pick(p0,p1,pickinfo) then
	if type(pickinfo.entity.script.TakeDamage)=="function" then
		pickinfo.entity.script:TakeDamage(10)
	end
end

This greatly simplifies our scripting system and allows different scripted objects to work together more easily.

Share this post


Link to post
Guest
This topic is now closed to further replies.
×
×
  • Create New...