Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why my Camera CFrame go really really far?

Asked by 3 years ago
Edited 3 years ago

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)
0
line 5, you essentially squared the default cframe. SteamG00B 1633 — 3y

2 answers

Log in to vote
0
Answered by
SteamG00B 1633 Moderation Voter
3 years ago
Edited 3 years ago

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.

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 Eager_Face 4 — 3y
0
I will post it in Answer Eager_Face 4 — 3y
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. SteamG00B 1633 — 3y
0
Or explain why you are dividing 68 by 500. That's just very specific with no explanation. SteamG00B 1633 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

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

0
This is not what answers are for, just update your question... SteamG00B 1633 — 3y
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. SteamG00B 1633 — 3y

Answer this question