You can see in the video that the frisbee stutters while it’s gliding. The frisbee is sliding on an invisible frictionless part. I don’t know what to do.
What are you using to make that work? RunService?
If you are using plain roblox physics modifiers like bodyvelocity, this is caused by lag in the workspace’s heartbeat.
So maybe instead just try simulating the movement/collisions in a script
I am not advanced enough to know what that means. I put the code in the the post
Please only show the code responsible for making the frisbee move bc otherwise it will be harder to find the problem
It’s in the “shot” function under the comment that says “set velocity”
I don’t know what you mean by this
basically move the thing/make it bounce in a script
the bouncing will just set its angle to the opposite relative to the side it touched, you can get that side via a raycast
Looks like @miguelfriend9228 is right; stuttering is probably caused by lag from physics engine so u might have to simulate.
This setup might help as a starting point
local isFrisbeeBeingThrown = false
local velocity = Vector3.new()
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.FilterDescendantsInstances = {frisbee, invisiblePart}
raycastParams.RespectCanCollide = true
local function progressThrow(deltaTime: number)
frisbee.Position += velocity * deltaTime
local raycastResult = workspace:Raycast(frisbee.Position, velocity.Unit * frisbee.Size.Z * 0.55, raycastParams)
if raycastResult == nil then return end
— this is where you handle collisions (you might want to do it differently)
velocity = raycastResult.Normal * velocity.Magnitude
end
RunService.RenderStepped:Connect(progressThrow)
Somewhere in the throw function you would set the velocity and isFrisbeeBeingThrown variables as appropriate.
This lag is caused by NetworkOwnership issues, just set the frisbee’s NetworkOwner to the server.
Code (at the very top of your script):
local frisbee=script.Parent
frisbee:SetNetworkOwner(nil)
Good idea; and although I’m not the OP, wld u pls explain why it’d be better in this case to set network owner to server versus client?
If you set the NetworkOwner to the client, you’ll have to set it to each new player that goes near the frisbee, and you’re risking security because now that client can delete the part (and it will replicate to the server). Way easier to do one line than setting up a bug-prone system like what I mentioned.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.