How Fling a Player Using Angular Velocity or LinearVelocity

So, This is actualy my animation:

I Already created a server script wich is connect onTouch Function, so basically when the hammer touches another player an action must be performed.

What I ask is that I want to use one of those two objects mentioned in the title to make it go up and push it to a random side, without throwing it off the map

Here’s what i mean:

First the player should get up and then he should be randomly thrown into a position

Can anyone help me on this? thank you!

3 Likes

Create a new LinearVelocity Instance, make its max force math.huge and randomise the VelocityForce’s x and z axis between -1000 and 1000.
If you don’t want to throw something off the map like you said, maybe do something a bit more tame like -100 to 100. For the y axis, I’d recommend randomising between 50 and 100.

Each instance you want to do this on will need an attachment as well for the Attachment0 property on the LinearVelocity.
If the Instance doesn’t have an attachment, just create one and destroy it when you’re done. For players, prefer the RootRigAttachment in the Character’s HumanoidRootPart.

Destroy the LinearVelocity Instance after .1 seconds using the Debris service and then gravity will do the rest.

1 Like

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