How could i Go on about Tweening a Model/Group in a viewportFrame Preview for Map voting?
Here is the code i have got so far. But i cant continue since CFrame cant Be used with models. Since Maps do not consist out of just a baseplate which i can tween, but loads of other parts, that would have been an easy way, but not what im looking for. I want to archieve a full 360 Tween. Is there a better way to do it? Im not experienced at all with tweening, i just want to get into that. Anyways; here is my code Provided, i’d appreciate any replies
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local VotingFolder = ReplicatedStorage:WaitForChild("Voting")
local c1 = VotingFolder.Choice1
local c2 = VotingFolder.Choice2
local c3 = VotingFolder.Choice3
local v1 = VotingFolder.Votes1
local v2 = VotingFolder.Votes2
local v3 = VotingFolder.Votes3
local previewFolder = ReplicatedStorage:WaitForChild("Previews")
local VotingEvent = ReplicatedStorage.Events:FindFirstChild("Voting")
local main = script.Parent
local c1gui = script.Parent:FindFirstChild("C1Frame")
local c2gui = script.Parent:FindFirstChild("C2Frame")
local c3gui = script.Parent:FindFirstChild("C3Frame")
local c1Cam = Instance.new("Camera")
c1Cam.Parent = c1gui.ViewportFrame
c1gui.ViewportFrame.CurrentCamera = c1Cam
c1Cam.DiagonalFieldOfView = 110
c1Cam.FieldOfViewMode = Enum.FieldOfViewMode.Diagonal
local c2Cam = Instance.new("Camera")
c2Cam.Parent = c2gui.ViewportFrame
c2gui.ViewportFrame.CurrentCamera = c2Cam
c2Cam.DiagonalFieldOfView = 110
c2Cam.FieldOfViewMode = Enum.FieldOfViewMode.Diagonal
local c3Cam = Instance.new("Camera")
c3Cam.Parent = c3gui.ViewportFrame
c3gui.ViewportFrame.CurrentCamera = c3Cam
c3Cam.DiagonalFieldOfView = 110
c3Cam.FieldOfViewMode = Enum.FieldOfViewMode.Diagonal
local TweenService = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(5,Enum.EasingStyle.Linear)
VotingEvent.OnClientEvent:Connect(function(Argument, VotingTime)
warn("event recieved")
if Argument == "votingBegan" or Argument == "votingEnded" then
if Argument == "votingBegan" then
local c1Prev = previewFolder:FindFirstChild("c1")
local c2Prev = previewFolder:FindFirstChild("c2")
local c3Prev = previewFolder:FindFirstChild("c3")
c1Prev.Parent = c1Cam.Parent
c1Cam.CFrame = CFrame.new(Vector3.new(0, 45, 0), c1Prev:FindFirstChild("MapBaseplate").Position)
c2Prev.Parent = c2Cam.Parent
c2Cam.CFrame = CFrame.new(Vector3.new(0, 45, 0), c2Prev:FindFirstChild("MapBaseplate").Position)
c3Prev.Parent = c3Cam.Parent
c3Cam.CFrame = CFrame.new(Vector3.new(0, 45, 0), c3Prev:FindFirstChild("MapBaseplate").Position)
main.Visible = true
elseif Argument == "votingEnded" then
main.Visible = false
c1Cam.Parent:FindFirstChild("c1"):Destroy()
c2Cam.Parent:FindFirstChild("c2"):Destroy()
c3Cam.Parent:FindFirstChild("c3"):Destroy()
end
end
end)