Code:
function Update(self)
self.boxTL = Vector(self.Pos.X - 24 , self.Pos.Y - 24);
self.boxBR = Vector(self.Pos.X + 24 , self.Pos.Y + 24);
self.boxboundary = Box(self.boxTL , self.boxBR);
for p in MovableMan.Particles do
if p.PresetName == "cube edge glow" then
if not self.boxboundary:WithinBox(p.Pos) then
p.ToDelete = True;
end
end
end
end
"p" is what you're calling all particles in movableman. WithinBox is a function based on the box, NOT on your particle; you have to use "boxname":WithinBox(vector to check), not "particletocheck:WithinBox(boxname)". It seems counterintuitive but it actually isn't. Also, you can use if not, rather than if then do nothing else do something.
And CC's vector coordinates are all based as if the entire scene were the fourth quadrant of a graph; more Y pushes you down and more X pushes you right.