Hello so i was trying to make a system where a player clashing with another player I tried to make it like make the player face the other player and have space behind them here’s a example.
Yea so basically i want the players Character Face the Other Players character with a offset
I tried To World Space And Cframe.LookAt but it just made the problem worse
local Event = script.Clash
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local SSS = game:GetService("ServerScriptService")
local Assets = ReplicatedStorage.Assets
local Remotes = ReplicatedStorage.Remotes
local Replication = Remotes.Replication.Replication
local function StopMovement(Humanoid : Humanoid)
Humanoid.WalkSpeed = 0
Humanoid.JumpPower = 0
end
local function BreakVelocitys(Character : Model)
for i,v in Character:GetDescendants() do
if v:IsA("BodyVelocity") or v:IsA("LinearVelocity") then
v:Destroy()
end
end
end
Event.Event:Connect(function(NarutoPlayer,SasukeCharacter)
-- SASUKE IS THE RIG ALWAYS
-- NARUTO IS THE PERSON ALWAYS
local NarutoCharacter : Model = NarutoPlayer.Character
local NarutoHumanoidRootPart : BasePart = NarutoCharacter.HumanoidRootPart
local NarutoHumanoid : Humanoid = NarutoCharacter.Humanoid
local SasukePlayer : Player = game:GetService("Players"):GetPlayerFromCharacter(SasukeCharacter) or SasukeCharacter
local SasukeHumanoidRootPart : BasePart = SasukeCharacter.HumanoidRootPart
local SasukeHumanoid : Humanoid = SasukeCharacter.Humanoid
-- Public Varibles
local offset = CFrame.new(0,0,10)
-- Private Varibles
StopMovement(NarutoHumanoid)
StopMovement(SasukeHumanoid)
BreakVelocitys(SasukeCharacter)
SasukeHumanoidRootPart.Anchored = true
SasukeHumanoidRootPart.Position = NarutoHumanoidRootPart.Position
SasukeHumanoidRootPart.CFrame = NarutoHumanoidRootPart.CFrame * offset
end)
if you can help me make the Sasuke HumanoidrootPart Face the other players rootpart and position it with a equation that would help most certainly.