Hello,
I trying to make zoom in/out 3rd person camera, here is the code:
if mouseWheelPos > 0 then
if self.camDist < self.camMaxDist then
self.camDist = mouseWheelPos * 1
if self.camDist > self.camMaxDist then
self.camDist = self.camMaxDist
numer = self.camMacDist
end
end
elseif mouseWheelPos < 0 then
if self.camDist > self.camMinDist then
self.camDist = mouseWheelPos * 1
if self.camDist < self.camMinDist then
self.camDist = self.camMinDist
number = self.camMinDist
end
end
end
System:Print(tostring(self.camDist))
self.cam:SetPosition(Vec3(0, -self.camDist, 0))
I can say its kinda working, but need make more smoother, any tips?