Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why my Camera CFrame go really really far?

I am trying to use divide to make my camera limitation which makes my camera not go really far but it just went really far

game:GetService("RunService").RenderStepped:Connect(function()--Up Barrier
	Mouse.Idle:Connect(function()	
	if Mouse.Y <= -34 then
	local MoveVector = Vector3.new(0,(34*2) , 0)/500 -- The part that i said
	Camera.CFrame = DefaultCFrame * CFrame.new(DefaultCFrame.p + MoveVector)
	DefaultCFrame = CFrame.new(DefaultCFrame.p + MoveVector)
	print(DefaultCFrame)		
		end
	end)	
end)

1 comment

0

line 5, you essentially squared the default cframe.

2 answers

In line 5 all you had it do was multiply the default CFrame by itself plus an extremely small vector. What I think you wanted to do was to multiply it only by the small move vector.

game:GetService("RunService").RenderStepped:Connect(function()--Up Barrier
    Mouse.Idle:Connect(function()   
    if Mouse.Y <= -34 then
    local MoveVector = Vector3.new(0,(34*2) , 0)/500
    Camera.CFrame = DefaultCFrame * CFrame.new(MoveVector)
    DefaultCFrame = CFrame.new(DefaultCFrame.p + MoveVector)
    print(DefaultCFrame)        
        end
    end)    
end)

If this answers your question, then don't forget to mark it as accepted.

4 comments

0

It does help but it does not solve the problem , I was trying to make the limitation for my camera on line 4 ,The main problem is when i

0

I will post it in Answer

0

If it helps but doesn't do it for you, then you need to make tweaks on your limiting vector, divide 1 by 500 if you want it a lot smaller.

0

Or explain why you are dividing 68 by 500. That's just very specific with no explanation.

Well i decided to use / to make a limit for my Camera which makes my camera not going really really far

local MoveVector = Vector3.new(0,(34*2) , 0)/500

I am asking why is my Camera go so far even i use limit for my Camera or if the way when i use limit is wrong ,please teach me

2 comments

0

This is not what answers are for, just update your question...

0

And seriously, I already answered and explained it in my post. It has nothing to do with that line, it has to do with the fact that you are squaring the default CFrame.

This discussion is preserved as it was. New answers, comments, and votes are closed.