|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
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 |
|
|
|
| 08 Jul 2011 02:53 AM |
| Ah, OK. Do I put [game] before [Workspace]? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 08 Jul 2011 03:28 AM |
| Thanks for the info, guys! Anyone else? |
|
|
| Report Abuse |
|
|
OBFAlt
|
  |
| Joined: 06 Jul 2011 |
| Total Posts: 35 |
|
|
| 08 Jul 2011 03:37 AM |
| CFrame actually has 12 values. :D |
|
|
| Report Abuse |
|
|