-
What do you want to achieve? Keep it simple and clear!
I’m trying to grab a few parts and call the relative function, in this case a cutscene. I do this by firing a remote event from the server to all clients. The client recieves the event, and calls the cutscene. The problem here is that I have a map that gets cloned from the server which mean all descendents of the map is cloned as well. But since all is cloned, how would you index the right parts to call the cutscene? -
What is the issue? Include screenshots / videos if possible!
I don’t have any clue on how to play the cutscene when it’s relevant parts are cloned. Is there any way to identify them? -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Couldn’t find any solutions.
If every children of that map is cloned and parented to workspace, it would be a simple matter of grabbing the right locations of those parts as this is necessary to the cutscene. However this doesn’t seem to be working. Is there any way to go about this?
This line sends the remote event over to all clients so that the client can receive it and call the cutscene.
game.ReplicatedStorage.Cutscene:FireAllClients()
This is the cutscene itself
local TweenService = game:GetService("TweenService")
local camera = game.Workspace.Camera
function tween(part1,part2,cutsceneTime)
local tweenInfo = TweenInfo.new(
cutsceneTime,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = part1.CFrame
local tween = TweenService:Create(camera, tweenInfo, {CFrame = part2.CFrame})
tween:Play()
wait(cutsceneTime)
camera.CameraType = Enum.CameraType.Custom
end
game.ReplicatedStorage.Cutscene.OnClientEvent:Connect(function()
tween(game.Workspace.NukeCity:WaitForChild("Test1"),game.Workspace.NukeCity:WaitForChild("Test2"),5)
print("recieved 1 - 2")
tween(game.Workspace.NukeCity:WaitForChild("Test2"),game.Workspace.NukeCity:WaitForChild("Test3"),6)
print("recieved 2 - 3")
end)
The problem is that it’s not identifying these parts: “Test 1, Test 2, Test 3”. Why is that?
Theoretically it should work, because the model(the map) named NukeCity is cloned, and parented to the workspace, and these parts are within it. Simply you would then index the right location to those parts? Am I doing something wrong here? And yes there are no error, nor any prints.