Please help, body mover going crazy!

The knockback that I’ve made goes super crazy when going too close to the enemy. Here’s a video:

Not only is it going crazy, it’s driving me crazy!
I cant seem to find what I’ve done wrong. Here’s the knockback code:

--This is the knockback function
function CombatModule.Knockback(Parent, Velocity, Lifetime)
	local Knockback = Instance.new("BodyVelocity")
	Knockback.Parent = Parent
	Knockback.MaxForce = Vector3.new(math.huge, 0, math.huge)
	Knockback.Velocity = Velocity
	game.Debris:AddItem(Knockback, Lifetime or 0.1)
end
--


--Here's what I input into the function

--Normal M1
CombatModule.Knockback(EnemyRoot, (HumanoidRootPart.CFrame.LookVector * 15))


--Final M1
CombatModule.Knockback(EnemyRoot, ((HumanoidRootPart.CFrame * CFrame.new(0,3,0)).LookVector * 50), 0.5) 
--

Any help would be very much appreciated!

Have you tried using different velocity/force that are up to date?

I’ve only ever used the old body movers.

Oh, it could be that using deprecated instances, but otherwise I don’t know what’s the problem.

I’ve only noticed it now and I’ve done lots of previous testing before. I’m wondering if it’s an update or something and that I need to move to the new bodymovers. Although I’d quite like to stick to BodyVelocity.

What changes have you made since it was last working as expected?

I made guis with local scripts that display health and stamina. Also made some other guis that aren’t scripted. I’m thinking of maybe using an alternative (newer) bodymovers but I’m not familiar with any others.

They’re pretty easy to use if you use the OneAttachment mode, definitely would recommend using those ones instead.

1 Like

What is the OneAttachment mode? I have absolutely no experience with the new ones so I’ll go search for posts.

Try Using AssemblyLinearVelocity (IK its not a typo its weird coding grammar). You would do something like Parent.AssemblyLinearVelocity = Velocity*500 (You should play with the numbers you multiply with or it will go berserk)

1 Like

I would not recommend just applying it for one frame as it will result in inconsistencies if the player is on the floor or airborne.

Sorry mb I meant that its an option he can try to implement, however he will have to figure out how to make it work better. You are right that it is probably inconsistent though.

Velocities work much better on the client, so you could try using it there.
(this info is from my experience so you can take it with a grain of salt)

One other option is using the AlignPosition (I hate it too). It is annoying because you need to make a whole new part and two attachments to get it to work but ig it gets the job done. (roblox why deprecate good bodymovers? ;-; )

I really wish Bodymovers weren’t deprecated because they did work well and were easy to use. (still are but glitchy) I will try these solutions and thanks very much to everyone who has replied.