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

Tips for knockback in a fighting game? [closed]

Asked by 4 years ago

Recently I've been working on a combat system, I've gotten everything to work except for the knockback. I've been trying to look for a good way to implement knockback but I can't find any good tutorial online. I've heard that BodyVelocity works, but it doesn't fit the style of what my game will be like. Does anybody have tips for implementing knockback?

Closed as Not Constructive by JesseSong

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago
local Speed = 40
local Force = 80000

local TotalForce = Force

local KnockBack = Instance.new("BodyVelocity")
KnockBack.Parent = part.Parent:FindFirstChild("HumanoidRootPart")--part is the target of the knockback/ the opponent

KnockBack.MaxForce = Vector3.new(TotalForce,TotalForce,TotalForce)
KnockBack.Velocity = Character:FindFirstChild("HumanoidRootPart").CFrame.LookVector * Speed -- based on the direction YOUR character is facing.

Idk if this works for you, but you should try it.

Ad