Lua Attachable Test Failure
Okay, so I decided to do a little test on the new Lua+Attachable functionality, and see if I could make an underslung grenade launcher using an AEmitter bound to burst whenever the "F" key was pressed, with a burst spacing of 3 seconds so as not to be excessively cheap. I loaded up CC to test it, and tried to fire the gl to no avail. Sadly no errors popped up either.
Here's my script:
Code:
function Create(self)
self.rootactor = nil;
local curdist = 50;
for actor in MovableMan.Actors do
local avgx = actor.Pos.X - self.Pos.X;
local avgy = actor.Pos.Y - self.Pos.Y;
local dist = math.sqrt(avgx ^ 2 + avgy ^ 2);
if dist < curdist then
curdist = dist;
self.rootactor = actor;
end
end
function Update(self)
if self.rootactor ~= nil then
if UInput:KeyHeld(6) then
self.BurstTriggered = 1
self.EmissionAngle = self.rootactor.AimAngle
end
end