Re: In need of a simple script
Really a ray isn't going to do you any good here, since it can cause lag in large quantities and only looks on one direction. What you want is this short snippet here:
Code:
function Create(self)
self.minDistance = 10 --distance in pixels from the centre of the actor
end
function Update(self)
for actor MovableMan.Actors do
local actorDist = sqrt(actor.Pos.X^2+actor.Pos.Y^2)
if actorDist <= self.minDistance then
actor:GibThis() --Alter this to do whatever it is that you want.
end
end
There are simplifications of the seventh line there, but since I don't remember the functions this will suffice.