You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I am trying to make a simulation of a player being tackled and helped back up where you can see as if there is a helmet on you and you are getting tackled. The helmet is purely UI. -
What is the issue? Include screenshots / videos if possible!
https://gyazo.com/24e0b2f681402e51eb9e6439d6c2528c
What you see in client/player ^
The camera is moving correctly but it’s not at the right starting position so you can only have the character mimick the movement and not be able to see the actual animation
https://gyazo.com/a9ab876406191bc516f957259bf2996d
Server perspective ^^
The animation plays and the players humanoid is posiitoned correctly, although the camera seems to stay at spawn -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Server code
game.ReplicatedStorage.StartFPS.OnServerEvent:Connect(function(plr,animation)
print("a")
local track1 = workspace.wr.Humanoid.Animator:LoadAnimation(game.ReplicatedStorage.Animations[animation].WR)
local track2 = workspace.cb.Humanoid.Animator:LoadAnimation(game.ReplicatedStorage.Animations[animation].CB)
track1:Play()
track2:Play()
game.ReplicatedStorage.StartFPS:FireClient(plr)
repeat
plr.Character.HumanoidRootPart.CFrame = workspace.wr.HumanoidRootPart.CFrame
plr.Character.HumanoidRootPart.Anchored = true
wait(.01)
until track1.Stopped:Wait()
end)
server script that moves the animation for the player to look at
local RunService = game:GetService("RunService")
local Character = game.Workspace.wr
local Camera = workspace.Camera
-----------IMPORTANT, PUT THIS IN A LOCAL SCRIPT INSIDE OF STARTER PLAYER SCRIPTS!----------------------------------------------
function Cinematic()
local CinematicsFolder = game.Workspace.Animation_Camera
local CurrentCameraCFrame = workspace.CurrentCamera.CFrame
Camera.CameraType = Enum.CameraType.Scriptable
local FrameTime = 0
local Connection
--CurrentCameraCFrame.Position = Vector3.new(89, 4.531, 18.951)
--CurrentCameraCFrame.Rotation = Vector3.new(176.785, 0.576, -179.968)
workspace.CurrentCamera.CFrame = workspace.CameraPart.CFrame
Connection = RunService.RenderStepped:Connect(function(DT)
local NewDT = DT * 60
FrameTime += NewDT
local NeededFrame = CinematicsFolder.Frames:FindFirstChild(tonumber(math.ceil(FrameTime)))
if NeededFrame then
Character.Humanoid.AutoRotate = false
Camera.CFrame = Character.HumanoidRootPart.CFrame * NeededFrame.Value
else
Connection:Disconnect()
Character.Humanoid.AutoRotate = true
Camera.CameraType = Enum.CameraType.Custom
Camera.CFrame = CurrentCameraCFrame
end
end)
end
--local Animator1 = game.Workspace.wr:WaitForChild("Humanoid"):WaitForChild("Animator")
--local Animator2 = game.Workspace.cb:WaitForChild("Humanoid"):WaitForChild("Animator")
--local Animation1 = script:WaitForChild("WR")
--local Animation2 = script:WaitForChild("CB")
--local animtrack = Animator1:LoadAnimation(Animation1)
--local animtrack2 = Animator2:LoadAnimation(Animation2)
game.ReplicatedStorage.StartFPS.OnClientEvent:Connect(function()
Cinematic()
end)
--wait(1)
local script that does the camera movement for the player to see from in POV
I am completely stumped and have no idea what to do or where to look for something like this
Can anybody help