Skip to content

Instantly share code, notes, and snippets.

View DavidCatalano's full-sized avatar

David Catalano DavidCatalano

View GitHub Profile
@DavidCatalano
DavidCatalano / perfectViewportFrameRotate.lua
Created September 11, 2022 21:59
Roblox perfectly sized Viewport Frame with model rotation
-- Perfect ViewportFrame Script with 360 degree Rotate
-- thanks to @sleitnick https://www.youtube.com/watch?v=2J-2v_UqNDw for the hard part
-- Put this code in a LocalScript inside of a ScreenGui in StarterGui
-- Change the reference to the model a few lines down to point to your model
-- Delete rows 40 and below if you don't want the rotate code
local makeModelSpin = true -- change this to false to keep the model stationary
local viewportFrame = Instance.new("ViewportFrame")
local camera = Instance.new("Camera" , viewportFrame)