Trying to make a viewport frame, for some odd reason it is not working. Do you know why? Is there some proprety i need to change?
All i had to do is anchor it, it kept on falling. Careless errors.
Trying to make a viewport frame, for some odd reason it is not working. Do you know why? Is there some proprety i need to change?
All i had to do is anchor it, it kept on falling. Careless errors.
on what line is the error???
It says in line 21, in the output
that is what line???
Level:SetPrimaryPartCFrame(CFrame.new(ViewPortPoint))
its line 17 my bad
and what is level, is it model? because if not, you cant use :setPrimaryPartCFrame
You canât use SetPrimaryPartCFrame
on a mesh part. You need to do: Level.CFrame = CFrame.new(viewportPoint)
i get a new error:
08:27:04.029 - GetBoundingBox is not a valid member of MeshPart
08:27:04.030 - Stack Begin
08:27:04.031 - Stack End
Do you intend to work with a MeshPart, or did you want to work with a Model?
Well theres a model, which that meshpart is inside that model. They are both called LevelPart, i did something by renaming the other meshparts that are not inside a model, to levelpart2, and levelpart3. Now i get no errors but the viewport frame does not work. I want to work with a model.
Then I assume you meant to do: local Level = workspace:WaitForChild("LevelPart")
, if you wanted to get the model.
Would you post the error?
Set view port frame like this :
local target = workspace.target
local player = game:GetService("Players").LocalPlayer
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target
camera.CFrame = target.CFrame
camera.FieldOfView = 46
camera:WorldToViewportPoint(target.CFrame)
I already did:
local level = workspace:WaitForChild("LevelPart")
There now is an error, so here it is:
08:40:54.994 - CFrame is not a valid member of Model
08:40:54.994 - Stack Begin
08:40:54.995 - Stack End
This is the line erroring out.
Level.CFrame = CFrame.new(ViewPortPoint)
This time you have to change it back to SetPrimaryCFrame
Level:SetPrimaryPartCFrame(CFrame.new(ViewPortPoint))
new error:
08:53:22.508 - Stack Begin
08:53:22.509 - Stack End
and the line is
ViewportCamera.CFrame = CFrame.Angles(0,math.rad(R),0) * CFrame.new(ViewPortPoint + Vector3.new(0,0,CurrentDistance),ViewPortFrame)
I assume you meant to do:
ViewportCamera.CFrame = CFrame.Angles(0,math.rad(R),0) * CFrame.new(ViewPortPoint + Vector3.new(0,0,CurrentDistance),ViewPortPoint)
Have you checked the entire setup? Is the model anchored, is the viewportframe visible, etc.
Just checked, and now it works! Tysm. I should have though of that earlier. careless errors lol