maccchh
(mach)
#1
Im making a fighting game, and i want the player to get pushed backwards for a certain thing.
I use bodyvelocity and the code goes like this:
function createForce()
local BV = Instance.new("BodyVelocity")
BV.Velocity = Vector3.new(8, 0, 8)
BV.Parent = script.Parent.HumanoidRootPart
game.Debris:AddItem(BV, 0.3)
end
The issue with this is that its not pushed backwards, its just pushed sideways or front and sometimes backwards.
How can I make it that it detects the players position and change the velocity so it can push the player backwards from that position
CZXPEK
(czo)
#2
function createForce()
local Root = script.Parent.HumanoidRootPart
local BV = Instance.new("BodyVelocity")
BV.Velocity = Root.CFrame.LookVector * -8
BV.Parent = Root
game.Debris:AddItem(BV, 0.3)
end
maccchh
(mach)
#3
Can I ask, how about making the player’s Y-axis go down aswell like down force
CZXPEK
(czo)
#4
function createForce()
local Root = script.Parent.HumanoidRootPart
local BV = Instance.new("BodyVelocity")
BV.Velocity = (Root.CFrame.LookVector * -8) + Vector3.new(0, -8, 0)
BV.Parent = Root
game.Debris:AddItem(BV, 0.3)
end
2 Likes
system
(system)
Closed
#5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.