[SOLVED] Spectate script (Realtime TweenService)

Ok, cool! My attempt was a bit weird
I’m gonna go ahead and say: your solution is 100000x better than mine lol
Also, what is the file size limit, It won’t let me put my video on.

It errors at 99%.

No your attempt was fine. Actually, yours is pretty similar to mine so they should work the same. Now that I think about it. Do you run the code on the server or the client?

Mine is run on the client, I don’t know how I can get the server to recognise any cameraInstances.
Also, does your code only follow from the head position, or does it snap to the player and let you orbit them? If it only follows them, that’s fine, I know a workaround

It snaps to the HumanoidRootPart but I cannot orbit them.

That’s fine, I can use some CFrame math to position it above their head looking down at them.
What code did you use?

I used a variable for where I want the camera to be so:


 local goal = {CFrame = spectatechar.HumanoidRootPart.CFrame*CFrame.new(DesiredCFrame,DesiredCFrame,DesiredCFrame)
1 Like

Just paste the code like this:

e.g.

hello

the word hello is sandwiched between two of these ```

Yeah!  like that. its better to use ``` though
1 Like

every single time I use TweenService I forget about the need to play the animation.

 TS = game:GetService('TweenService')
 while true do
     local goal = {

     ['CFrame'] = workspace.CamTarget.CFrame * CFrame.Angles(math.rad(-22.5),0,0)

     }

     anim = TS:Create(cam, TweenInfo.new(0.5, Enum.EasingStyle.Quad), goal)
     anim:Play()
     wait()

 end

Works pretty well! Going to do some CFraming to position it above + behind the target.

Got it to work! Thanks for all your help! :smile:

1 Like