How would I learn what to do for this knockback system?

Basically, the first step is to knock it exactly at a calculated knockback distance (dist + the position of the dummy) from a function I’ve created and see how much “potential force” if the force from the knockback distance collided with a wall along with the direction, and after that you combine the potential force + angle and apply impulse to the final position which is the combination and vector (20,y,z) y and z being where the dummy’s y and z coordinates would be.

Naturally, this sounds convoluted and messy to follow so I’ll add something to show what I want to replicate, the above was just my plan on how to implement it but feel free to recommend on parts of it.

But, my purpose of showing you this is to ask for any help/advice related to this (post, articles, etc) so if you could give me any tips that would be greatly appreciated but mainly mathematical/physics stuff.



1 Like

so, you want a system to where the closer to the dummy and faster the player is moving, the more velocity is added to the knockback?

No, I just want the dummy to be applied velocity to two different positions. One being a simple distance + position and the other being the final position of a simulation in a collision when it loses its velocity to be put simply. I’m making a game similar to the one to the gif, sorry.

  1. set the dummy’s velocity to vector3.new(0,0,0) this should stop all movement
  2. anchor the dummy model just to make sure
  3. check if the player’s Z position is greater then the dummy or not (do velocity based on that
  4. wait a few frames
  5. apply the calculated velocity
  6. add a script to the wall that when a humanoid touches it, the velocity is set to vector3.new(0,0,0) and anchor it, then send out a event to the main script
  7. then once the main hit script detects the wall detected the hit, wait a bit and then allow movement by anchoring

lemme know if it works!

1 Like

should look like this:

plrHitDummy.Event:Connect(function()
--- play animation first!
    [dummyHere].Anchored = true
    [dummyHere].Velocity = vector3.new(0,0,0)
    wait(0.1)
    [dummyHere].Anchored = false
    [dummyHere].Velocity = [what u defined here]
end)
wallHit.Event:Connect(function(charType)
    if charType == "player" then
        -- do whatever u do to damage player here
    else
        -- do whatever u do to damage dummy here!
    end
    wait(0.1)
    [dummy/player character].Anchored = false -- this will unfreeze plr
end)

reminder, the way you set it up might break the code so change the code up abit depending on setup!

1 Like

I’ll take this into direction, thank you for the sample code.

1 Like

im not a specialist at this kinda of thing, im just saying what my logic part of brain says alright so take some stuff i say with a grain of salt

1 Like

for those who want to know what I did to solve this conundrum, I just put elastic barriers a knockback calculator and it was finished

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.