Hello! I am Making A Story Type Game Where i Want to Make Some Interactive Things. Examples : Paintings Rotate 50 Degrees And Come Back to Normal after A Second When You Click Them.
Even Though I Have this Idea, I have No Clue on How i would Do This. Would i Use CFrame? If Yes,
Then How would i Use it for This?
The Model Has Two Parts. A Frame and A Screen i Want them Both to Rotate 50 Degrees When Clicked. (On Z Axis I think)
I have Inserted a Click Detector inside the Screen so when the The Player Clicks the Screen, The Painting Moves. But Now i Dont know What to Write in the Script.
Where Model is the variable that contains the model, this would rotate it by 50 degrees in one axis
You may have to experiment with the 3 angles of CFrame.Angles, reminder that it only accepts radians so must use math.rad() when you have a non-zero degree
And another reminder, make sure the Model has a PrimaryPart set up, you can go into the Properties of the Model, click o nPrimaryPart, and select one of the 2 parts
You need to setup a PrimaryPart. Go into the Properties of the Model ,Click on the empty field near PrimaryPart, and click on a part in the model to set it as a PrimaryPart
Glad that it worked! And since I didn’t mention about rotating it back, you can simply store the original CFrame in a variable and when you want it to return back, just set it back to the original CFrame
local Model = script.Parent
local originalCFrame = Model.PrimaryPart.CFrame
wait(10)
Model:SetPrimaryPartCFrame(originalCFrame * CFrame.Angles(math.rad(50),0,0))
wait(5)
Model:SetPrimaryPartCFrame(originalCFrame)
As an example. Or just use my CFrame.Angles example and just change the 50 to -50