you don’t want the model to rotate, you want the camera to rotate which keeps everything consistent and provides an illusion of the model rotating
LocalScript Example
local Player = game.Players.LocalPlayer
local RotateGui = script.Parent.Background
local Replicated_Storage = game:GetService("ReplicatedStorage")
local Folder = Replicated_Storage:WaitForChild("Folder"):GetChildren()
local ViewportFrame = Replicated_Storage:WaitForChild("ViewportFrame")
print(#Folder)
for i = 1, #Folder do -- loops through all children of Folder
local Clone = Folder[i]:Clone() -- clones the child
local PrimaryPart = Clone.PrimaryPart -- the clones primary part
local Offset = CFrame.new(0, 0, 7) -- the offset
-- cloning and setting up the viewportframe
local ViewportClone = ViewportFrame:Clone()
local Camera = Instance.new("Camera", ViewportFrame)
ViewportClone.CurrentCamera = Camera
Clone.Parent = ViewportClone
ViewportClone.Parent = RotateGui
spawn(function()
while true do
for i = 1, 360 do
Camera.CFrame = PrimaryPart.CFrame * CFrame.Angles(0,math.rad(i),0) * Offset
wait()
end
end
end)
end
btw the red part is the primarypart I showed how to set it up in a reply above
Like this for example, the white object is a smaller model, and thus appears smaller on the frame, however the seat object (the red one) is a larger model, and just takes up basically the entirety of the frame (can’t even see the entirity of the model)
Are there work arounds to this? I don’t wanna set the camera to be far away to fit in larger models as then smaller models would be too small to see at all
I suggest using coroutines instead of spawn. Also, you can even use a ModuleScript that takes an object and angle offset (if it faces the wrong way) so you can organize the code better.
But great job! I’m happy you guys found a solution
The L shaped couch is incredibly small. The smallest couch (in the middle of the UI) is the larger.
Here the hitboxes have been made half transparent. The Hitboxes are the PrimaryPart for each model. The L shaped couch uses two parts unioned together to make 1 hitbox.
Guessing the hitbox sizes have something to do with it. These have to be sized like this and the PrimaryPart as I use them for placement. Would I need to add another part like you have (the red dot part) in like the centre, that way it’s all the same size and position, etc.?
Elaboration: Centering it may or may not require another part(or CFrame for slightly advanced method)
GetExtentsSize().Z makes them look smaller, it zooms away from the object. Right now it’s trial and error to find the expected result. OOF!
An ideal way to deal with this is to use an invisible part that is the largest possible model that can be added. Using that part, we can now have consistent model sizes in ViewportFrame.
The small blue cube is 1x1x1 and in the exact centre of each model. However the models still appear incredibly small. Removing :GetModelExtentSize() and setting the Z on the offset to say 10 just means that bigger items may be too big to fit and smaller items will be too small to see
That is not a ideal way as size does not matter, the issue here is shape if you scroll up you can see I posted a huge chair and a smaller one and both looked the same in viewport
All the items are big and clear, and even tho the items in sims have different sizes, they all look big and clear in the UI, while the items inside my viewports look real bland, and small
Hmmm that would make sense. What would be the best way then to get the objects to look the same as the objects in the sims ui? No rotation. Just position of the camera and getting the model to face forward