[SOLVED] setWorldPosition: Can't Interact w/ Buttons ...
Posted: Mon Nov 03, 2014 1:32 am
I'm writing a parameter-based script to place multiple buttons/levers on a wall and things were going well until I discovered that I can't interact with buttons or levers that have been placed with setWorldPosition on the north and east walls. The full script takes rotation into account, but here is a simple one to demonstrate my problem. It places four levers in the same square with the script all facing in and kicks the levers to the side with setWorldPosition. I can only flip levers on the south and west walls. Why? Is this broken for others too? Puts a kink in my scripts - the buttons/levers look nice, easy to place, but are useless.
I searched the forums, but no luck so far. Thanks, -Lark

Code: Select all
for i = 0, 3 do
ctl = spawn("lever", self.go.level, self.go.x, self.go.y, i, self.go.elevation, self.go.id .."_lever_"..i)
pos = ctl:getWorldPosition()
j = i % 2 * 2 + 1
pos[j] = pos[j] + .4
ctl:setWorldPosition(pos)
end