generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Cframe Problem (scripting)

Previous Thread :: Next Thread 
SMELLYJOJOJOJOJOJOJO is not online. SMELLYJOJOJOJOJOJOJO
Joined: 05 Mar 2011
Total Posts: 1322
21 Dec 2011 12:19 PM
I am trying to make a large section of anchored bricks move up in unison, this is my current script:

function up()
for n = 1, 538 do
wait()
for n = 1,222 do


script.Parent["Part" ..n].CFrame = CFrame.new(script.Parent["Part" ..n].Position + Vector3.new(0,0.1,0))

-- (The above is one line.)

end
end
end


It works well, but when it moves each of the bricks lose their set angle. How could I make it so that they keep their .fromEulerAnglezXYZ() property?
Report Abuse
MyrcoMyrcoMyrcoMyrco is not online. MyrcoMyrcoMyrcoMyrco
Joined: 03 Sep 2011
Total Posts: 1013
21 Dec 2011 12:24 PM
Because you use position to set it to a CFrame datavalue, it'll cut of the rotation. Also next time post this in SH.

    function up()
        for n = 1, 538, 1 do
            wait()
            for n = 1, 222, 1 do
                script.Parent["Part" ..n].CFrame = CFrame.new(script.Parent["Part" ..n].CFrame + Vector3.new(0,0.1,0))
            end
        end
    end

~Myrco; Music lover, nederlands/dutch and a scripter
Report Abuse
sncplay42 is not online. sncplay42
Joined: 27 Nov 2008
Total Posts: 11891
21 Dec 2011 12:32 PM
Why have you passed a CFrame to CFrame.new

script.Parent["Part" ..n].CFrame = script.Parent["Part" ..n].CFrame + Vector3.new(0,0.1,0)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image