Is it possible to tween a part in a local script?

So I have a part of my game where one of the NPCs turns around to look at the player during a dialogue sequence, but I want the NPC to turn around for each player who enters the sequence. When I tried to tween the NPC’s orientation in a local script, it didn’t work. How do I work around this?

Please feel free to ask for screenshots of my code/game, though be warned I’m still fairly new to scripting.

That makes no sense. You were tweening CFrame on an Anchored part, right?

show your code please
(character requirement)


I have tried both CFrame and Vector3
While using Vector3 though the rig just moved a few studs into the ground

  1. use task.wait(1), not wait(1). wait() is deprecated and shouldn’t be used.
  2. Tween the CFrame, not Orientation, and then make sure the NPC’s Network Ownership is set to the client who is tweening it. What’s probably happening is the physics/replication engine on the server is keeping the NPC at its intended location. Here’s a document on Network Ownership.
2 Likes

So I tried tweening CFrame again, but the rig is moved far away from where it should be. Do you know what that means?


Here is the code I made, please let me know if this is wrong
Edit: I am tweening the HRP btw. Saying this because just in case it’s wrong

You’re setting it to 0,0,0 positionally, the property is not an adjustment, its the actual value.

Al;so, given this is an NPC, you actually need to tween a CFrameValue instance and then use its .Value to call NPC:PivotTo(CFrameValue.Value) per heartbeat, as you cannot tween a Model’s CFrame (it has none)

1 Like


I JUST figured it out, my own code was the problem, sorry to disturb anyone : D

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.