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

(I Still Need Help)Can somone help me with this CFrame Rotation Problem?

Asked by 9 years ago

Ok, I have a rocket silo that raises up, as the silo raises I have a rocket clamp on the top or it. it starts off in the down (Rotation)position(-0.003, -0.084, 90), as it moves up the clamp(ArmRotatorTwo) has to Rotate around to (-0.003, -0.084, -65)

As the Model rotates it also as to move to maintain its position.

it move up and over at the same time.

the code that I have been working on kind of works. I put print commands to see if it was working.

all of the print commands and count commands work fine. the movement up and over works fine,

the rotation does one move only to (-0.003, -0.084, 0) and then stops.

I don't understand why the rotation code isn't working

can someone help me please?

I have some local variable's but not all used yet but that's later.

I have been looking for videos on this kind of thing for 2 days if anyone know were I can find good videos let me know, Thanks!

local ArmOne = script.Parent.Parent.ArmRotatorTwo.ArmOne
local ArmTwo = script.Parent.Parent.ArmRotatorTwo.ArmTwo
local Rotater = script.Parent.Parent.BraceRotater
local Four = script.Parent.Parent.ArmRotatorTwo.PartFour
local One = script.Parent.Parent.ArmRotatorTwo.PartOne
local Three = script.Parent.Parent.ArmRotatorTwo.PartThree
local Two = script.Parent.Parent.ArmRotatorTwo.PartTwo
local Brace = script.Parent.Parent.ArmRotatorTwo.Brace
local Left = script.Parent.Parent.ArmRotatorTwo.LeftArm
local Right = script.Parent.Parent.ArmRotatorTwo.RightArm
local Model = ArmTwo.Parent
local Prime = Model.PrimaryPart
local ArmRotation = ArmTwo.Rotation.Z
local NumberOne = 0
local NumberTwo = 0


    Rotater.CanCollide = false
    ArmOne.CanCollide = false
    ArmTwo.CanCollide = false
    Four.CanCollide = false
    One.CanCollide = false
    Three.CanCollide = false
    Two.CanCollide = false
    Brace.CanCollide = false
    Left.CanCollide = false
    Right.CanCollide = false


function Rotate()
    wait(.5)

    print ("Start")

    while (ArmRotation > -65) do    

        Model:SetPrimaryPartCFrame(CFrame.new(Prime.CFrame.X - .05, Prime.CFrame.Y + .05, Prime.CFrame.Z))
        wait(.2)
print ("Done Step One")
        CFrame.Angles(Prime.Rotation.X, Prime.Rotation.Y, Prime.Rotation.Z - 0.05)

print ("Done Step Two")     
        NumberOne = NumberOne + 1

        print(NumberOne)

        wait(.2)
       end          
    end

    script.Parent.ClickDetector.MouseClick:connect(Rotate)  

    wait(.1)

    Rotater.CanCollide = true
    ArmOne.CanCollide = true
    ArmTwo.CanCollide = true
    Four.CanCollide = true
    One.CanCollide = true
    Three.CanCollide = true
    Two.CanCollide = true
    Brace.CanCollide = true
    Left.CanCollide = true
    Right.CanCollide = true


0
I dont understand wy all the print commands and count commands work but the rotation only moves one time and stops.( I thinkg that i have it wrong, i think i am telling it a new rotation position not changing it every time.)I just dont know how to fix it Snipers7777 0 — 9y

Answer this question