Hello so I recently tried to make a script that would clone a part in front of u then make it go in the same direction u are facing but I failed and i don't know how to fix it. Part with problem is written in the script with " -- Part with problem" along with explanation
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr)
plr.Chatted:connect(function(msg)
if plr.Name == "My username." then
if msg == "Red" then
local hi = game.Workspace.AlexTest.boio:Clone()
hi.Parent = chr
hi.CFrame = chr.Torso.CFrame * CFrame.new(0,0,-5)
hi.Orientation = chr.Torso.Orientation - Vector3.new(0,90,0)
hi.Name = "Red"
hi.Anchored = false
chr.Humanoid.WalkSpeed = 0
-- ^ clone the tool, bring it in front of my torso facing the same direction as my torso.
hi.p.Position = Vector3.new(chr.Torso.CFrame * CFrame.new(0,0,-5000)) -- Part with problem.
--https://gyazo.com/bf847c8fdbe6deb1fee00dd9f8e20156
-- this is what happens.
chr.Humanoid.WalkSpeed = 16
wait(10)
hi:Destroy()
end
end
end)
end)
end)
There are 2 problems.
- It's going down but I can't anchor it because it won't move then.
- It's not moving in the direction my torso is facing.
Note: hi.p is a BodyPosition.

2 comments
sorry let me rephrase, bodyposition is to pull things towards a specific point, body velocity is to move something forward
Thank you very much! sorry for the late reply! it works perfectly