Part with BodyVelocity jittery when it touches anything

Hello all, I have made a simple script that makes a part randomly roam around the map using a body velocity, but when the part collides with anything, the motion appears to become jittery and only shows up as random teleportations instead fluid motion.

The part is meant to be collected as a power up so there is another script handling collisions, but everything in that is dependent on the collision handler finding a humanoid, so I can’t imagine that it affects the motion in any way.

This problem does not show up in the server mode of the play test, but it does show up for the player, and on the real game as well. It ultimately isn’t a huge problem but if there is a simple fix for this it would be greatly appreciated, otherwise I will rework the script using something different like a body position or something else.

local rand = Random.new()
local p = script.Parent
while wait(0.5) do
script.Parent.BodyVelocity.Velocity = Vector3.new(rand:NextInteger(-35,35),0,rand:NextInteger(-35,35))
script.Parent.Orientation = Vector3.new(0,0,0)
end
1 Like

If you haven’t already, you should probably set the part’s can-collide to false.

I do want it to collide with things, though. Otherwise it might wander into people’s bases or outside of the map entirely