So, I have scaled camera focused view (stationary while learning), in case that’s important.
I’m running this function from the LUA module without assigning it to a variable.
I put test positioning just like I’m planning to put further as I’m putting my physics together.
Does someone have any clue why it might wiggle?
function h_move(inst) --Get direction local hin = 0 if (bit.band(inst.buttons, right) > 0) then --bitmasking for right button hin = hin + 1 end if (bit.band(inst.buttons, left) > 0) then --bitmasking for left button hin = hin - 1 end local x = inst.spd.x if hin ~= 0 then --move x = x + hin * inst.ACC x = clamp(x, -inst.MAX, inst.MAX) else --deaccelerate x = approach(x, 0, inst.DCC) --(value, goal, ammount) end --testing inst.spd.x = x local pos = go.get_position(inst.MY_URL) pos.x = math.floor(math.abs(pos.x + x)) * sign(pos.x) go.set_position(pos, inst.MY_URL) print(pos.x) end