I am making a comedy game and at the start of the game, a Dummy plays in a cutscene and wakes up.
Once it wakes up, since the Player isn’t the Dummy, the Player should change position(teleport) and stay in front of the bed.
I have a script which changes player’s Camera settings and when the player changes it’s position the Camera breaks, the Camera Offset breaks and the player movement breaks as well.
Unfortunately my file size was to big so I had to paste in the link.
This is what happens without the Position changing:
https://1drv.ms/v/s!AqC33HMFxhmCjigAVMcMojjvip4Y?e=B4EcE2
And this is what happens with the Position changing:
https://1drv.ms/v/s!AqC33HMFxhmCjilRiCrIGjc4lcRO?e=AvuhiP
I tried making a player transparent instead of him changing it’s position and I tried to use Character.HumanoidRootPart.Position = Vector3.new(0, 0, 0)
instead of
Character.HumanoidRootPart.Position = game.Workspace.RoomPart.Position
Here is a picture of my Explorer:
This is the FirstPersonCamera script in which I’m trying to make it so whenever a player presses the Play button, the game waits until the cutscene ends and changes Player’s Camera:
wait(10)
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid
local camera = game.Workspace.CurrentCamera
player.CameraMaxZoomDistance = 0.5
camera.FieldOfView = 80
humanoid.CameraOffset = Vector3.new(0, 0.5, -1.5)
for childIndex, child in pairs(character:GetChildren()) do
if child:IsA("BasePart") and child.Name ~= "Head" then
child:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function(plr)
child.LocalTransparencyModifier = child.Transparency
end)
child.LocalTransparencyModifier = child.Transparency
end
end
end)
This is the WakingUpCutscene script:
wait(0.1)
local camera = game.Workspace.camera2
local cam = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
cam.CameraType = Enum.CameraType.Scriptable
local pos = Vector3.new(-584, 11.702, -65.6)
local LookAt = Vector3.new(-590.5, 6.302, -60.5)
local camCFrame = CFrame.new(pos, LookAt)
cam.CFrame = camCFrame
wait(7)
local pos = Vector3.new(-587, 7.702, -60)
local LookAt = Vector3.new(-576.537, 5.102, -59.588)
local camCFrame = CFrame.new(pos, LookAt)
cam.CFrame = camCFrame
wait(3)
cam.CameraType = Enum.CameraType.Custom
end)
And finally this is the RoomPositionScript:
local Player = Players.LocalPlayer
local Character = Player.Character
script.Parent.MouseButton1Click:Connect(function(Player)
wait(10)
Character.HumanoidRootPart.Position = Vector3.new(-585, 4.102, -60)
end)```