Wyzloc
(Wyzloc)
December 9, 2021, 6:05pm
#1
Here’s a simple script for rotating a part:
local part = workspace.Part
game:GetService("RunService").Heartbeat:Connect(function()
part.CFrame = Part.CFrame * CFrame.Angles(0,1,0)
end)
But what if you wanted this spinning part to follow your character as well while it’s spinning? What would you do?
Scottifly
(Scottifly)
December 9, 2021, 6:18pm
#2
You can try modifying the script in this post:
Hello! I have experienced the same issue as I was testing out the module but quickly came to fix this. If your still interested this is the fixed script:
local PetFollowModule = {}
local ModuleFunctions = {}
local Folders = {}
local Settings = require(script.Settings)
local LocalPlayer = game.Players.LocalPlayer
local YPoint = 0
local Addition = Settings.YDriftSpeed
local FullCircle = 2 * math.pi
local RunService = game:GetService("RunService")
local IsServer = LocalPlayer
local MasterFold…
I just typed in ‘pets’ in the search bar up top.
Wyzloc
(Wyzloc)
December 10, 2021, 1:14am
#3
I don’t quite understand what that code means, i’d prefer if someone just explained how it’s done with a small sample of code as a demonstration.
Also I’d just like to say that I think that code from the link you sent me is a bit over complicating things. There’s likely a more simpler approach. I know how to move something along with a character, but making it spin and move along with the character is a different story.
Wyzloc
(Wyzloc)
December 10, 2021, 1:47am
#5
What am I doing wrong? It should be spinning shouldn’t it?
game:GetService("RunService").Heartbeat:Connect(function()
workspace.ShurikenModel:SetPrimaryPartCFrame(script.Parent.Head.CFrame * CFrame.Angles(0,math.rad(1),0))
end)