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

How to make a character move with the spinning part using CFrame?

Asked by 2 years ago

I'm trying to rotate a model using its PrimaryPart. It is working, but it doesn't move my character. I tried using BodyForce and Constraints like weld and hinge, but nothing works. I saw an answer in the DevForum saying you will use LookVector, but I didn't understand how. Here's the code:

while true do
    script.Parent:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame() * CFrame.fromEulerAnglesXYZ(0,0.05,0) * CFrame.new(0, 0, 0))
    wait()
end

It would be much better and appreciated if you changed the script for me. I would still appreciate your time for this problem. Thanks!

1 answer

Log in to vote
1
Answered by
Puppynniko 1059 Moderation Voter
2 years ago
Edited 2 years ago

Use a CylindricalConstraint or HingeConstraint make sure AcuatorType is Motor add a attachment to a part and set the HingeConstraint.Attachment0 to the part you want to spin and HingeConstraint.Attachment1 to a part thats anchored and inside of Attachment

0
I didn’t expect for someone to answer my question 1 month later. T3_MasterGamer 2189 — 2y
0
I’ve actually tried HingeConstraint and it didn’t work but sure I’ll try CylindricalConstraint. T3_MasterGamer 2189 — 2y
0
also you might be setting it up wrong as i tried it and it worked perfectly fine with both and you can get a free model from the toolbox that has this just search Spinning platform Puppynniko 1059 — 2y
Ad

Answer this question