Blender 2 Player Cutscene to Roblox

Hi fellow developers, i just created a 2 player cutscene animation.(cutscene not yet added) but i ran into some issues.

  1. What do you want to achieve? I want to align both the characters to exactly how it was in blender

  2. What is the issue? Both the characters dont align well in studio but they do in blender

  3. What solutions have you tried so far? I tried pivoting the target’s cframe to the User’s cframe and offsetting it by 3 studs on the z axes but it doesnt work.I also tried making the target face the user but that doesnt work as well.

this are the videos:

Studio:

Blender:

Local Script:

	local enemyHumanoidRootPart = data.EnemyHumanoid.Parent.HumanoidRootPart
	local HumanoidRootPart = data.Humanoid.Parent.HumanoidRootPart
	
	task.wait(0.5)

	enemyHumanoidRootPart.CFrame = HumanoidRootPart.CFrame + (HumanoidRootPart.CFrame.LookVector * Vector3.new(1.5, 0, -2.5))
	enemyHumanoidRootPart.CFrame = CFrame.new(enemyHumanoidRootPart.Position, HumanoidRootPart.Position)	
	
	local UserAnimation: AnimationTrack = data.Humanoid.Animator:LoadAnimation(data.UserAnimation)
	local TargetAnimation = data.EnemyHumanoid.Animator:LoadAnimation(data.TargetAnimation)
	
	
	UserAnimation:Play()
	TargetAnimation:Play()

Server Script:

local function EnableCollisions(user, target)
	for _, part in user:GetDescendants() do
		if part:IsA("BasePart") then
			part.CollisionGroup = "Player"
		end
	end

	for _, part in target:GetDescendants() do
		if part:IsA("BasePart") then
			part.CollisionGroup = "Player"
		end
	end

	user.Humanoid.WalkSpeed = 12
	user.Humanoid.JumpHeight = 7.2
	user.Humanoid.AutoRotate = true 

	target.Humanoid.WalkSpeed = 12
	target.Humanoid.JumpHeight = 7.2
	target.Humanoid.AutoRotate = true 
end

local function DisableCollisions(user, target)
	for _, part in user:GetDescendants() do
		if part:IsA("BasePart") then
			part.CollisionGroup = "User"
		end
	end
	
	for _, part in target:GetDescendants() do
		if part:IsA("BasePart") then
			part.CollisionGroup = "Target"
		end
	end
	
	user.Humanoid.WalkSpeed = 0
	user.Humanoid.JumpHeight = 0
	user.Humanoid.AutoRotate = false 
	
	target.Humanoid.WalkSpeed = 0
	target.Humanoid.JumpHeight = 0
	target.Humanoid.AutoRotate = false 
end

local function Cutscene(hitbox: Part, data)
	local isNpc = false
	--Detect hit
	--Play Cutscene
	--Set Camera Position
	local connection
	connection = hitbox.Touched:Connect(function(hit)

		if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Humanoid").Health >= 1 and hit.Parent ~= data.Character then
			print(hit.Parent.Name)
			local User = Players:GetPlayerFromCharacter(data.Character)
			local Target = Players:GetPlayerFromCharacter(hit.Parent)
			
			if Target == nil then isNpc = true end
			
			katanaRemote:FireClient(User, "DisableRun")
			
			local remoteData = {
				
				UserAnimation = data.UserAnimation,
				TargetAnimation = data.TargetAnimation,
				Humanoid = data.Character.Humanoid,
				EnemyHumanoid = hit.Parent.Humanoid,
				HumanoidRootPart = data.Character.HumanoidRootPart,
				EnemyHumanoidRootPart = hit.Parent.HumanoidRootPart
			}
			
			onCutsceneActivated(User, Target, isNpc, remoteData) --Disables collisions and fires remote to both of the clients
			destroyWeld(data.Character.HumanoidRootPart, "DS Weld", 0)
			hitbox:Destroy()
			connection:Disconnect()
		end
	end)
endlocal function Cutscene(hitbox: Part, data)
	local isNpc = false
	--Detect hit
	--Play Cutscene
	--Set Camera Position
	local connection
	connection = hitbox.Touched:Connect(function(hit)

		if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Humanoid").Health >= 1 and hit.Parent ~= data.Character then
			print(hit.Parent.Name)
			local User = Players:GetPlayerFromCharacter(data.Character)
			local Target = Players:GetPlayerFromCharacter(hit.Parent)
			
			if Target == nil then isNpc = true end
			
			katanaRemote:FireClient(User, "DisableRun")
			
			local remoteData = {
				
				UserAnimation = data.UserAnimation,
				TargetAnimation = data.TargetAnimation,
				Humanoid = data.Character.Humanoid,
				EnemyHumanoid = hit.Parent.Humanoid,
				HumanoidRootPart = data.Character.HumanoidRootPart,
				EnemyHumanoidRootPart = hit.Parent.HumanoidRootPart
			}
			
			onCutsceneActivated(User, Target, isNpc, remoteData) --Disables collisions and fires remote to both of the clients
			destroyWeld(data.Character.HumanoidRootPart, "DS Weld", 0)
			hitbox:Destroy()
			connection:Disconnect()
		end
	end)
end
1 Like

and yes i did disable collisions during runtime

1 Like

Make sure that Touched is not triggered more than once.

Turn off the animations, and take a look. See if they stand in for each other.
If they don’t, use this code

Use fixConnection:Disconnect() only when the animation ends


local RS = game:GetService("RunService")

local fixConnection
fixConnection = RS.Heartbeat:Connect(function()
	remoteData.EnemyHumanoidRootPart.CFrame = remoteData.HumanoidRootPart.CFrame
end)

wait(10)
fixConnection:Disconnect()

I disconnect the touched event immediately after it registers a character.In the local script i set the enemy’s HumanoidRootPart to the User’s humanoidRootPart with an offset and it works.But for some reason i cant get the right position and orientation.And in some extreme cases when i use the skill, the enemy just goes flying

And i cant use this tho cause i want the enemy to fly up to the sky.

but thanks for replying! every reply helps

Not sure if this will help but; the humanoid’s hip height can cause animation offset issues at longer distances, check if its exactly at 2

ohh sorry how do i check it? Is it a property

Yes, its a property under the humanoid

hmm i tried it but doesnt really seem like a lot of difference

Well im not of much help then.
Also check the player’s character i guess

hmm yea i already checked it and its there.

Alright guys i tried welding the enemy’s humanoidRootPart to the user’s humanoidRootPart and it works hooray but its not consistent at all when i try with other rigs.

I set the C1 to an offset of CFrame.new(0, 0, -2)

It works perfectly when i import a my own character rig but when i try on the default r15 rig, it just flings everywhere or it positions itself in a weird way

this is the code:

local function weldBothPlayers(User, Target)
	local weld = Instance.new("Weld")
	weld.Part0 = User.PrimaryPart
	weld.Part1 = Target.PrimaryPart
	
	weld.C1 = CFrame.new(0, 0, -2)
	weld.Parent = User.PrimaryPart
	
	Debris:AddItem(weld, 9)
end

If i use my own character as the target, it looks like this:

Hmm i tried it again and i set the weld’s z-axes to -2.8 which more or less works but its not very consistent.Thanks for this reply tho

	weld.C1 = CFrame.new(0, 0, -2.8)

but if yall got any more ideas feel free to comment them as its not fully fixed yet :+1:

Nevermind I more or less fixed ir