please help
It seems that everytime it freezes, the character looks at a specific direction. Is there any code that meant to run if you’re moving for a certain amount of time?
No, it just looks north I think. The blocks you see are just for making the character look in a certain direction which just uses an align orientation.
Oh yeah, and also if I enable streamingEnabled, it doesn’t let the character move at all.
Try to make the Cancollide of the head to false, idk if this will work or not. Or maybe you need to show ur script to us to help you
Mk, so I actually have a couple scripts since it’s humanoidless.
Note: lingo is a short name for the LinearVelocity.
So this is the code that makes it go: (Im probably gonna make it simpler later)
local userInputService = game:GetService("UserInputService")
local lingo = script.Parent.lingo
local max = 25
userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.W then
lingo.VectorVelocity += Vector3.new(0,0,max)
end
end)
userInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.W then
lingo.VectorVelocity -= Vector3.new(0,0,max)
end
end)
userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.A then
lingo.VectorVelocity += Vector3.new(max,0,0)
end
end)
userInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.A then
lingo.VectorVelocity -= Vector3.new(max,0,0)
end
end)
userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.S then
lingo.VectorVelocity += Vector3.new(0,0,-max)
end
end)
userInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.S then
lingo.VectorVelocity -= Vector3.new(0,0,-max)
end
end)
userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.D then
lingo.VectorVelocity += Vector3.new(-max,0,0)
end
end)
userInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.D then
lingo.VectorVelocity -= Vector3.new(-max,0,0)
end
end)
And this is the code for the look stuff
wait(1)
local RunService = game:GetService("RunService")
local seat = script.Parent.Te
local seat1 = script.Parent.Tee
local Camera = workspace.CurrentCamera
Camera.CameraSubject = script.Parent.eyes
Camera.CameraType = Enum.CameraType.Custom
Camera.FieldOfView = 60
Camera.CameraSubject = script.Parent.shoulder
RunService.RenderStepped:Connect(function()
local camCF = Camera.CFrame
local look = camCF.LookVector
local top = Vector3.new(0, 1, 0)
local right = look:Cross(top)
seat.CFrame = CFrame.fromMatrix(seat.Position, right, top, -look)
seat1.CFrame = Camera.CFrame - Camera.CFrame.Position + seat1.Position;
if (Camera.CFrame.Position - Camera.Focus.Position).Magnitude <= 0.6 then
Camera.FieldOfView = 100
Camera.CameraSubject = script.Parent.eyes
else
Camera.FieldOfView = 60
Camera.CameraSubject = script.Parent.shoulder
end
end)
Any help is appreciated.
That’s maybe the issue here? Maybe the game is switching between the player having network ownership of the character and the server having network ownership.
So what would adding a wait() before the linerVelocity do and where?
also it just freezes at random intervals no matter what I press
if so, any ideas how to fix that?
Do
HumanoidRootPart:SetNetworkOwner(nil)
Somewhere at the top of the script
Uh so would I have to put this in a normal script and where? cus it said that “network ownership api can only be called by the server”
Put it in the server script, somewhere at the top
umm, what server script? like in server script storage?
and is it supposed to be nil?
Just ignore what I have said cuz I have misunderstood ur problem. Try @Judgy_Oreo method. If it is work, then ok. If not, you can try to uninstall ur roblox studio (Sometimes roblox studio will have some unexpected problem). And also, I have found sth that maybe can help you to understand SetNetworkOwner.
https://developer.roblox.com/en-us/articles/Network-Ownership
So I finally got around to it, and it COMPLETELY got rid of the problem!! thanks so much for the suggestion!
You credited the wrong person with the solution… if the issue was network ownership you should be crediting @Judgy_Oreo since it was their suggestion… just saying.
Yeah, @xXRed_VoidXx should choose @Judgy_Oreo
method as solution if this is because the problem of network ownership. I just find sth about network ownership.
I only say this so other people searching this topic can find the solution quickly… not because you didnt help you had good ideas
Sorry, it had been a while so I forgot about the suggestion he made.
No worries, i just glad they were able to help you and others can now find the solution quickly.