BodyVelocity frezzes for a second

Hey guys,
I have a problem with BodyVelocity as for some reason, when I create the part with a BodyVelocity, the parts moves for a milisec and then freezes and continues moving. pls help

The script that is run in the server:

local speed = 60
	local bullet = Instance.new('Part', workspace)

	bullet.Size = Vector3.new(5,5,5)
	bullet.BrickColor = BrickColor.new("Really red")
	bullet.Shape = "Ball"	
	bullet.CanCollide = false
	
	bullet.Anchored = false
	
	local body_velo = Instance.new('BodyVelocity', bullet)
	
	bullet.Position = origin
	body_velo.Velocity = (origin-goal).Unit * -1 * speed
	body_velo.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
	
	body_velo.P = 2000
	
	local BodyForce = Instance.new("BodyForce")
	BodyForce.Force = Vector3.new(0, bullet:GetMass() * workspace.Gravity, 0) --Weight = Mass * Acceleration, (f = ma).
	BodyForce.Parent = bullet

The bullet:

You may need to force physics on your bullet by using the power of the Network Ownership.
Network Ownership allows you to do smooth and improve physics!

2 Likes

I tried it and the frezze of the bullet happens when the Server owns the Bullet.

But when the client owns the bullet. it moves smoothly and doesnt frezee.

I would use the client as the owner of the bullet, but the players will be able to exploit with Tab Glitching and frezee the bullet whenever they want. and i dont want that happens, so idk

You could create a client bullet and a server bullet. Only the client bullet is visible, and only the server bullet does any hit detection.

It’s a hassle, but I think it’s worth it. Good luck with this.

1 Like

If this is a one player game, then script most on the client (with in reason of course). The small delay you are seeing is the time it takes for the server to replicate the body velocity on the client.

2 solutions you could use:

  1. Use the client

  2. Use TweenService (I dont recommend using this as a solution though, this is last resort.)

2 Likes

i think is a good idea i will try that

  1. my game is a multiplayer one so I cant script the behaviour of the game in a local script
  2. the delay also happens in the server
  3. the 1
  4. i need to use physics for the touch events and that stuff
    but anyways thanks

client is actually in the power to calculate physics much better than server as server’s does inaccurate calculations on physic so this is was my solution but however, security for Network Ownership is awful.

as you said, everything is right that people can exploit and abuse this feature but you’re still able to use client (like, replicate client request to server, i guess) as this is much better at calculating physics!