-- Horizontal/Vertical trigger
function obj46()
	if (obj.flags(0x100)) then -- Follow mode
		local movespeed = math.floor(TILE*FRACUNIT/4)-1;
		if (obj.flags(0x1000)) then -- Follow on the Y axis.
			if (obj.y() < myobj.y()) then
				obj.momy(movespeed)
			elseif (obj.y() > myobj.y()) then
				obj.momy(-movespeed)
			else
				obj.momy(0)
			end
		else -- Follow on the X axis
			if (obj.x() < myobj.x()) then
				obj.momx(movespeed)
			elseif (obj.x() > myobj.x()) then
				obj.momx(-movespeed)
			else
				obj.momx(0)
			end
		end
		obj.do_collisions(true) -- Stay within your area

		if (math.abs(obj.x() - myobj.x()) >= TILE*FRACUNIT) then
			return -- Out of range
		elseif (math.abs(obj.y() - myobj.y()) >= TILE*FRACUNIT) then
			return -- Out of range
		end
		obj.runevent() -- Event reached!
	elseif (obj.flags(0x1000)) then -- Vertical trigger
		if (math.abs(obj.x() - myobj.x()) < TILE*FRACUNIT) then
			obj.runevent()
		end
	else -- Horizontal trigger
		if (math.abs(obj.y() - myobj.y()) < TILE*FRACUNIT) then
			obj.runevent()
		end
	end
end
