They multiplying the speed by the magnitude of the player and the ghost
It works but now its a little too smooth, heh. It doesn’t accurately show the player their position on the server.
Also the ghost seems to push the player too everything it see to can collide false but the head and torso turn true when they get spawned in
Heres a clip of them both:
https://gyazo.com/4ec3dcebbc4a3fb0bdd0817bf6c17313
Edit: the red lines represent the servers hitbox aka where the server sees the player
I see what you mean, we just going to have to tweak
So that it’s more instant, I’m not that great when it comes to memorising the properties of most instances let me see if I can find a way to improve it…
EDIT:
This probably what we are looking for…
So I could just set it with math.huge
and make it instant?
Though I don’t know how to fix the ghost collision I had the issue too but assumed I didn’t rig the ghost properly.
Also do not do math.huge to the ‘P’ property otherwise your gonna have some nasty results, when I say nasty I mean it doesn’t move at all for some reason.
thats strange because when I set it to math.huge I got flung
try setting to something above 10000 seems to me i get better results its for you to experiment with
Created a new version so that player doesn’t collide with ghosts let me just get final test then I can post it for everyone…
EDIT: Here It is hopefully works fine do send me video of this as it is interesting to see
local runserver = game:GetService("RunService")
local physics = game:GetService("PhysicsService")
physics:CreateCollisionGroup("playersGroup")
physics:CreateCollisionGroup("ghostGroup")
physics:CollisionGroupSetCollidable("playersGroup", "ghostGroup", false)
local Ghosts = {}
runserver.Heartbeat:Connect(function(plr)
for plrName, info in pairs(Ghosts) do
if info["Char"]:FindFirstChild("HumanoidRootPart",false) then
info["GhostBodyTrack"][1].Position = info["Char"].HumanoidRootPart.Position
info["GhostBodyTrack"][2].CFrame = info["Char"].HumanoidRootPart.CFrame
end
end
end)
game.Players.PlayerAdded:Connect(function(plr)
local ghost = nil
plr.CharacterAdded:Connect(function(char)
for _, v in pairs(char:GetChildren()) do if v:IsA("BasePart") then physics:SetPartCollisionGroup(v, "playersGroup") end end
ghost = game.ReplicatedStorage.Copy.Debug.GhostPvpChar:Clone()
ghost.Parent = game.Workspace["Ghosts"]
local bodyposition = Instance.new("BodyPosition",ghost.HumanoidRootPart); bodyposition.MaxForce = Vector3.new(math.huge,math.huge,math.huge); bodyposition.P = 50000
local bodygyro = Instance.new("BodyGyro",ghost.HumanoidRootPart); bodygyro.MaxTorque = Vector3.new(10000,10000,10000)
Ghosts[plr.Name] = {
["Ghost"] = ghost;
["Player"] = plr;
["Char"] = char;
["GhostBodyTrack"] = {bodyposition,bodygyro}
}
char.Humanoid.AnimationPlayed:Connect(function(recentanimation)
for i, track in pairs (ghost.Humanoid:GetPlayingAnimationTracks()) do
track:Stop()
end
local recentanimation = recentanimation.Animation
local hum = ghost.Humanoid
local anim = hum:LoadAnimation(recentanimation)
anim:Play()
end)
end)
end)
workspace.Ghosts.ChildAdded:Connect(function(ghost)
for _, part in pairs(ghost:GetChildren()) do
if part:IsA("BasePart") then
physics:SetPartCollisionGroup(part, "ghostGroup")
end
end
end)
Just create a folder for the ghosts called Ghosts in workspace
EDIT 4: Just removed test code sorry about that
It looks almost identical to the one from the game
https://gyazo.com/366734012cadce1fe8489747a83977f8
What can i say im just pro Mark it as solution if your happy about the results so other people who want to implement it can find it easier
oh no, I just found another error about the script the instant I click solution… When I equip a weapon all the animations stop
Edit: heres a link https://gyazo.com/706aaf9d0b9657530059b44e9551845e
I also think its because I’m connecting motors to the character when i equip a tool
Since the “ghost” doesn’t have Motor6D of the tool it doesn’t play the animation as it doesn’t have the joint
What you can do is get what ever motor6d of tool your using and replicate it the ghost since I don’t know the motors that you add to character I won’t be able to make the change…
The Motor6d is parented to the weapon model which is parented to the players character
Every time the player equips the tool the motor will connect to the right arm while when it unequips it connects to the torso. I’m assuming that it will work if I add a part called Handle and a motor inside of it connecting the handle and the right arm. just tried it, it didn’t work.
Did you name the motor “BodyAttachment” just making sure if it was done correctly.
Also is this model in a roblox tool object.
1: Yes I did name it correctly
2: No this is not a model inside a tool
Ah then how was this animated? Was it just a normal animation what I mean is did you use the tool during the animation?
Yes I used the tool during animation and to be more specific I used Headstackk’s meathod.
Give me a second, let me view the community tutorial, i’m not really an animator or good at animations so it’s my first hearing about his method of animation let me see how you did it.
Ok sorry my bad, what I think you did wrong was did you clone the motor or did you create a new motors with the same names?
What do you mean? clone the motor into the ghost via a script?