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 » Scripting Helpers
Home Search
 

Re: CFrame

Previous Thread :: Next Thread 
TheLoneWolf9669 is not online. TheLoneWolf9669
Joined: 12 Dec 2008
Total Posts: 746
08 Jul 2011 01:18 AM
OK, I was planning on using this "CFrame" thing, but I have a few questions.

First off, according to the wiki, this is the code for tilting a brick:

[game.Workspace.Brick.CFrame=CFrame.fromEulerAnglesXYZ(0, 0, 0)]
Now, if I put .78(which is 45 degrees, also accroding to the wiki) in the first 0, that'll make the brick turn 45 degrees, right?

Secondly, according to the wiki, this code sends a brick high into the air:

[game.Workspace.Part.CFrame = CFrame.new(0, 50, 0)]
Now, if I put the 50 in the first 0 spot, that'll send it very far out in front, right?

Third, how can I tell how far the brick will go?
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
08 Jul 2011 01:36 AM
I'm pretty sure if you wnt to move a brick you use this:
game.Workspace.Part.Position = Vector3.new(X,Y,Z)
^^^^^^
Use this over game.Workspace.Part.CFrame = CFrame.new(0, 50, 0)

And for the Brick CFrame, and what position do you want to add .78 to?
Report Abuse
TheLoneWolf9669 is not online. TheLoneWolf9669
Joined: 12 Dec 2008
Total Posts: 746
08 Jul 2011 01:39 AM
Ah, OK, thanks fr that first part.

"And for the Brick CFrame, and what position do you want to add .78 to?"
You mean, what direction do I want it to turn? Or out of X,Y,Z?
Report Abuse
TheLoneWolf9669 is not online. TheLoneWolf9669
Joined: 12 Dec 2008
Total Posts: 746
08 Jul 2011 01:56 AM
Eh, bump.
Report Abuse
OBFAlt is not online. OBFAlt
Joined: 06 Jul 2011
Total Posts: 35
08 Jul 2011 02:08 AM
There's a bit easier way to rotate stuff than the wiki's way, especially if you want it to keep the same position.


Workspace.Brick.CFrame = Workspace.Brick.CFrame*CFrame.Angles(X,Y,Z)

To move stuff, you can use CFrame (CFrame.new), or Position (Vector3.new). Using CFrame would make the brick move to that position, regardless of what else is there. Position, if it tries to move into a brick, will just go above it.
Report Abuse
TheLoneWolf9669 is not online. TheLoneWolf9669
Joined: 12 Dec 2008
Total Posts: 746
08 Jul 2011 02:53 AM
Ah, OK. Do I put [game] before [Workspace]?
Report Abuse
OBFAlt is not online. OBFAlt
Joined: 06 Jul 2011
Total Posts: 35
08 Jul 2011 02:54 AM
You don't need to. It's just something more to write.
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
08 Jul 2011 02:54 AM
You do know thats completely optionable right?
You do not have to put game for anything in Workspace.
I'm not sure if it works for all the others like StarterGUI, Players, Lighting, etc.
Report Abuse
Aerideyn is not online. Aerideyn
Joined: 16 Jan 2010
Total Posts: 1882
08 Jul 2011 03:07 AM
its purely workspace which is case insensitive and does not require "Game" all other services require both.

make sure you anchor your part before you cframe it if you want to place it within another brick or it will just pop on top like normal.
Report Abuse
TheLoneWolf9669 is not online. TheLoneWolf9669
Joined: 12 Dec 2008
Total Posts: 746
08 Jul 2011 03:28 AM
Thanks for the info, guys! Anyone else?
Report Abuse
OBFAlt is not online. OBFAlt
Joined: 06 Jul 2011
Total Posts: 35
08 Jul 2011 03:37 AM
CFrame actually has 12 values. :D
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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