Greetings! im working on a morph type system between 3 types of balls and a normal player. Im working on making it keep the camera be the same just in a different sometimes the same ball.
This code is appart of a larger code but its un related to it and has like 2 other things that arnt apart of changing the camera
game.ReplicatedStorage.ChangeCamera.OnClientEvent:Connect(function(H)
local CamC = Camera.CFrame
if H then
Camera.CameraSubject = workspace:WaitForChild(game.Players.LocalPlayer.Name):WaitForChild("Humanoid")
else
Camera.CameraSubject = workspace:WaitForChild(game.Players.LocalPlayer.Name):WaitForChild("HumanoidRootPart")
end
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(0,5,0)
Camera.CameraType = Enum.CameraType.Custom
if workspace:FindFirstChild(game.Players.LocalPlayer.Name):HasTag("Boulder") then
Controls:Disable()
else
Controls:Enable()
end
end)
These lines are the ones that change the camera
local CamC = Camera.CFrame
if H then
Camera.CameraSubject = workspace:WaitForChild(game.Players.LocalPlayer.Name):WaitForChild("Humanoid")
else
Camera.CameraSubject = workspace:WaitForChild(game.Players.LocalPlayer.Name):WaitForChild("HumanoidRootPart")
end
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(0,5,0)
Camera.CameraType = Enum.CameraType.Custom
So, the problem with your code is that you change the cameratype to scriptable. This means you can change it with scripting. Then you move it, and then change it back to custom. When you change it back to custom, it goes back to where it was before.
Ok so i want it like normal but when you morph to the ball or plr it doesent have that ugly choping type thing with the camera. i want it to just move to the new ball / plr at the same orientation and distance from the player
So like if the cam was pointed upwards and you morph it would be the same distance from the camera subject and orientation as the last camera subject so it would be at the same distance from plr looking upwards
Ah. Okay. That is a more complicated process. To do that, you probably would need to tween the camera, although I’m not sure that this will even work.
The first step would be to set the camera type to scriptable.
Then, we disable the player’s movement and jumping capabilities.
Then, we tween the camera to the other object with the same offset from the focus part of the camera.
Then, we change the camera’s focus part,
And finally, we set their camera type back to custom and give back their jump height and movement speed.
my main need with this isnt making the position smooth cause normally the position would the same
cause im just reseting the character to the same place (A solution to a throw )
Yes, although we need to change the camera’s focus part to a part of the new character and tween it with some complicated CFrame stuff to make sure it will work.