Problems with .Velocity

hold up, The body position is sending the ball way too much and after it hits the player, it flys out of the world and flys back in, imma try linear velocity rq

Hmm, yeah try that out it could actually work better since its giving the ball a velocity and you can control the speed much better

1 Like

I’m having trouble controlling the speed of the ball, its either EXTREMELY slow or EXTREMELY fast.
with * CSpeed its way to fast but without its really slow

		clonedBall.LinearVelocity.VectorVelocity = direction * CSpeed
		clonedBall.LinearVelocity.MaxForce = math.huge

Oh Gosh, I’m dumb, when I was trying body position I set the accel to math.huge and forgot to fix it. XD

1 Like

BasePart.Velocity is deprecated, AFAIK AssemblyLinearVelocity should work for your use case? Also BodyPosition’s are deprecated, you should use AlignPosition for new work. I say that because BodyPosition’s could break in the next update and they wouldn’t fix it.

Also to follow up, don’t set the MaxForce of any constraints to math.huge. It has a large chance of making the simulation unstable and you should use a large number constant.

1 Like

ok so it works really well, except at higher speeds, is there a way to make the momentum INSTANTLY change direction? like how when a baseball hits a bat, the ball instantly goes a different way.
robloxapp-20231127-1301181.wmv (1.2 MB)

Actually, I have a gravity script and .Velocity still works for me on the newest version of studio