Part not rotating on client [Fixed]

Hello,
So I’m trying to make a killer part that rotates on the client (local script)
I write the code that should rotate the part, but it only rotates the part when the player spawn close to the part.

  • I tried to fix that by waiting for the game to load repeat task.wait() until game:IsLoaded()
    but it didn’t solve the problem.
  • Also tried to tag the parts that should rotate, but it still didn’t work.
  • Tried to use a ChildAdded event to wait when the parts will add. Didn’t work.
  • Tried to use Content Provider to preload the parts but didn’t work.
  • Tried to fire a remote event from the server providing the part but it gave me an error, that the part don’t exist on the client (nil)

Any other ideas that could work?

2 Likes

Could you share the script that the issue applies to? It’s unclear to see where the issue arises from without it.

2 Likes

It could be a problem with Network Ownership. Does the part need to rotate for everyone?

2 Likes

Did you create the part on the client using a script or added it through workspace?

2 Likes
local move = Vector3.new(0,studs,0)

local tweenInfo = TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,-1,true)

local tween = ts:Create(part,tweenInfo,{Position = part.Position + move})
tween:Play()

I think the problem is that I’m trying to rotate a part that far away that player can’t so it (so it doesn’t exist)

It should rotate only for the local player

1 Like

I created it by inserting it on the workspace

A part always exists, it just doesn’t render if you’re too far away

You should create the part on the client through a localscript if only that one person is supposed to see it.

When I run the script while the part is rendered it rotates but when it’s far away it doesn’t rotate

Then try creating by local script

Since it’s a killer part it has a .touched event running on the server.
Its just should rotate on the client. Doesn’t metter if other players see it, on they screen the part will rotate differently

Hm. So your issue is the part doesn’t rotate from far away but you can see it from that distance?

The problem is that when i run run the studio if the part is so far away that i can’t see it, when i get close it’s not rotating but when i run the studio and the part is close to me it’s rotating.

So your part isn’t rotating when studio is not in play mode?

That’s no issue, scripts only run while studio is in play mode

it’s not rotating when i play the game

1 Like

I think if game starts with the player close to kill part it rotates but if you spawn far away and go to kill part it’s not rotating.

Can we see the whole script?

Have you tried to turn off StreamingEnabled? It’s a property in Workspace. StreamingEnabled restricts to only load places where the player is, which won’t yet to load parts far away and can cause problems to scripts.

This is an issue I’ve seen from many people in a community and it works for them at least.

1 Like

robloxapp-20231026-1454167.wmv (505.3 KB)
they are rotating when i spawned close

robloxapp-20231026-1456517.wmv (364.7 KB)
robloxapp-20231026-1458083.wmv (528.8 KB)
they aren’t rotating when i came from far