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

How can i make another NPC get pushed back on hit?

Asked by
oSyM8V3N 429 Moderation Voter
6 years ago

For ex: im doing a combo which is punch1, punch2, then kick and it sends the player backwards. Any idea on how i can do that?? I was thinking about using the onTouched function but im not sure how that would work out.

1 answer

Log in to vote
0
Answered by 6 years ago

I would say to put a BodyVelocity in the npc torso then do something with lookVector or something based on the npc's Torso's lookVector.

Maybe like this:

local velocity = Instance.new('BodyVelocity', (npc's torso)
velocity.MaxForce = 10000
velocity.Velocity = (npc's torso).CFrame.lookVector * Vector3.new(100, 0, 100)
0
maybe u could also mess with just the velocity of the torso itself and not add a bodyvelocity. MrDefaultMan 113 — 6y
0
Ohh, ok so i can just write when the player's arm hit the NPC's torso or so it makes a bodyvelocity? oSyM8V3N 429 — 6y
Ad

Answer this question