Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I rotate a model? [closed]

Asked by
nycdill -5
4 years ago

I’ve literally tried every script and none of them work

Closed as Not Constructive by WideSteal321, Necro_las, and raid6n

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
2
Answered by 4 years ago

rotate tool

0
lmao raid6n 2196 — 4y
Ad
Log in to vote
-1
Answered by
Necro_las 412 Moderation Voter
4 years ago
Edited 4 years ago

You can do that by using this: SetPrimaryPartCFrame

https://developer.roblox.com/en-us/api-reference/function/Model/SetPrimaryPartCFrame

model:SetPrimaryPartCFrame(cf)

The CFrame property includes position and orientation, so you can use its orientation to rotate.

For exemple, a script that keeps rotating a model forever:

while wait() do
    local Position = model.PrimaryPart.Position
    local Orientation = model.PrimaryPart.Orientation + Vector3.new(1,0,0)
    model:SetPrimaryPartCFrame(CFrame.new(Position,Orientation)
end