CFrame positioning: Difference between revisions

From Goodblox Wiki
Jump to navigationJump to search
(Created page with "= CFrame Positioning Tutorial = This is a short tutorial on position parts using CFrame. With "CFrame" you can put brick exactly where you want it, without it sh...")
 
mNo edit summary
 
Line 4: Line 4:


== Recommended building mode ==
== Recommended building mode ==
It is recommended that [[Goodblox Studio]]'s [[Edit mode]] is used, because the camera can be placed at any angle. To start the studio, go to where you extracted the ClientFinalized.zip file, and double click on RobloxApp.exe.
It is recommended that [[GoodBlox Studio]]'s [[Edit mode]] is used, because the camera can be placed at any angle. To start the studio, go to where you extracted the ClientFinalized.zip file, and double click on RobloxApp.exe.


After this, open the [[Command Bar|command bar]]. If you don't see this on the bottom of your screen, click View > Toolbars > Command. Or right click one of the toolbars and select 'Command'
After this, open the [[Command Bar|command bar]]. If you don't see this on the bottom of your screen, click View > Toolbars > Command. Or right click one of the toolbars and select 'Command'

Latest revision as of 03:19, 28 September 2021

CFrame Positioning Tutorial

This is a short tutorial on position parts using CFrame. With "CFrame" you can put brick exactly where you want it, without it shooting up into any other bricks that may be near it.

Recommended building mode

It is recommended that GoodBlox Studio's Edit mode is used, because the camera can be placed at any angle. To start the studio, go to where you extracted the ClientFinalized.zip file, and double click on RobloxApp.exe.

After this, open the command bar. If you don't see this on the bottom of your screen, click View > Toolbars > Command. Or right click one of the toolbars and select 'Command'

Starting position

First, you need to put the Part where you want it to be placed. This can be done with the move tool (this tool, or this tool.)

Tilting the Part

If you want the part to be tilted when it's placed, enter this code into the command bar:

game.Workspace.Brick.CFrame=CFrame.fromEulerAnglesXYZ(0, 0, 0)

Edit the numbers 0, 0, 0 to how much you want the part to be tilted, these are NOT degrees, these are Radians. 45° is 0.78 radians, so if you wanted to tilt a brick 45°, you would use:

game.Workspace.Brick.CFrame=CFrame.fromEulerAnglesXYZ(0, 0.78, 0)


For more information see: Vector3.

Positioning the brick

There are two ways to move it.

Moving by taking or adding from the current position.

If you wanted to move the part by itself, maybe down one to the x axis -0.2, you would use:

game.Workspace.Brick.CFrame = game.Workspace.Brick.CFrame + Vector3.new(-0.2, -1, 0)

Even though I'm using + Vector3.new(-0.2, -1, 0) you should never change the + to a -, it messes everything up. Instead, use negative numbers. Obviously change the Brick; ..ace.Brick.CFr..


Moving by taking or adding from another bricks position.

If you wanted to move said part, or brick, by another brick's position, maybe up 0.2 for the y axis, and -0.6 to the z axis, you would use:

game.Workspace.Brick.CFrame = game.Workspace.Brick2.CFrame + Vector3.new(0, 0.2, -0.6)

Creating a new position.

If you wanted to move said part, or brick, by a complete new position, you would use:

game.Workspace.Brick.CFrame = CFrame.new(0, 10, 0)

Closing Statements

You should now have successfully moved a part, or "brick", exactly where you want it.

See Also