Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i keep the position of character inside a part?

Asked by
VAnkata20 135
1 year ago
Edited 1 year ago

i am going and attack where you throw a scythe and the character that touches the scythe follows it to an end position

https://i.imgur.com/VXw2Jlf.mp4

I am currently using

spawn(function()
local back = Vector3.new(0,0,-3)
local up = Vector3.new(0,-3,0)
local bv = Instance.new("BodyVelocity", character:FindFirstChild("HumanoidRootPart"))
bv.Name = "Knockback"
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = hrp.CFrame.LookVector * 25 + back + up
game.Debris:AddItem(bv,.1) 
end)
0
can you show the full script? T3_MasterGamer 2189 — 1y
0
you can just loop a tp on the character to the part JustinWe12 723 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

I suggest using AlignPosition instead of BodyVelocity. Even though BodyVelocity is deprecated and was replaced with AlignPosition, AlignPosition is more like a BodyPosition – which would also fit better for this job than a BodyVelocity.

local ap = Instance.new("AlignPosition", character:FindFirstChild("HumanoidRootPart"))

local attach0 = Instance.new("Attachment", character:FindFirstChild("HumanoidRootPart"))
local attach1 = Instance.new("Attachment", your_scythe)
ap.Attachment0 = attach0
ap.Attachment1 = attach1

ap.Name = "Knockback"
ap.MaxForce = math.huge

game.Debris:AddItem(ap, .1)
game.Debris:AddItem(attach0, .1)
game.Debris:AddItem(attach1, .1) 
0
You're wrong. BodyVelocity was replaced with LinearVelocity. T3_MasterGamer 2189 — 1y
Ad

Answer this question