How would I send a raycast and give knockback

So, I am trying to script it so that a player sends a raycast towards where their mouse is pointing. If the raycast catches a different player’s character, then I want to give the different player’s character found in the raycast knockback.

This post is also connected to this: Ragdoll and Knockback problems - Help and Feedback / Scripting Support - DevForum | Roblox

1 Like

A good place to start is raycasting. You can calculate the direction of the knockback by comparing the positions of the sender and receiver.

Applying a VectorForce or LinearVelocity should probably be a pretty decent knockback effect.

1 Like