I have a ball hovering over a baseplate and when I release it I want to know how strong it hits the floor, but I don't know how to measure it correctly.
I've tried something with the Y axis velocity:
ball.Touched:connect(function(baseplate) print(ball.Velocity.Y) end
It's quite simple, but doesn't work. The problem is that when it hits the baseplate, it bounces instantly and the printed result is small and positive. Maybe the Touched event is slower than the physics rendering, so that method is useless.
Any suggestion to help me?
I'll attempt to make this for you, I'll have a loop that will record the Velocity, then It will stop looping when it touches a part.
local velocity,velocity2 local touched = false function callback() --Do this after touched print(velocity) end script.Parent.Touched:connect(function(p) if p.Name == "BasePlate" then --when they touch the part named... touched = true end end) spawn(function() while wait() do velocity = velocity2 velocity2 = script.Parent.Velocity.Y if touched then break end end end)
Hope it helps!