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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How to use CFrame using a script.

Previous Thread :: Next Thread 
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
01 Nov 2011 02:55 PM
Can someone tell me how to use CFrame when making a brick script.
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
01 Nov 2011 02:57 PM
Item.CFrame = item.CFrame * CFrame.Angles(0,0,0) -- rotation
Item.CFrame = CFrame.new(0,0,0) -- position
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
01 Nov 2011 03:00 PM
ok add cframe to this script

b = Instance.new("Part")
b.Parent = game.Workspace
b.Position = Vector3.new(5,5,5)
b.Size = Vector3.new(10,10,10)
b.BrickColor = BrickColor.new("Dark green")

Add cframe position in this script somewhere.
If color is broken please tell me. I only a beginner yet,
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
01 Nov 2011 03:03 PM
How about if i do this

b.CFrame = CFrame.new(...) --Please give me a position

or

b.CFrameValue = CFrameValue.new(...) --Please give me a position,
Report Abuse
deividaxas is not online. deividaxas
Joined: 20 Feb 2009
Total Posts: 1054
01 Nov 2011 03:12 PM
b = Instance.new("Part")
b.Parent = game.Workspace
b.CFrame=CFrame.new(Vector3.new(5,10,55)) --changed this line
b.Size = Vector3.new(10,10,10)
b.BrickColor = BrickColor.new("Dark green")
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
01 Nov 2011 03:34 PM
ok thx
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
01 Nov 2011 03:38 PM
It doesnt change rotation???
Report Abuse
sam6175 is not online. sam6175
Joined: 16 Aug 2008
Total Posts: 1391
01 Nov 2011 03:50 PM
Cframe isnt always rotation, it can be position as well
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
01 Nov 2011 03:53 PM
I want it to change rotation...
Report Abuse
br45entei is not online. br45entei
Joined: 06 Nov 2010
Total Posts: 1058
01 Nov 2011 03:56 PM
part = (pathname here)

while wait() do
part.CFrame = CFrame.new(script.Position.Value, script.LookVector.Value) * CFrame.Angles(script.Angle.Value.X, script.Angle.Value.Y, script.Angle.Value.Z)
end

For that, just have three Vector3Values inside the script, and name one "Position", and the next one "LookVector", then the last one "Angle". Then edit each until the part is to your liking. This is the simplest CoordinateFraming Tool I've come across, and it works Wonders.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
01 Nov 2011 04:00 PM
ok
Report Abuse
br45entei is not online. br45entei
Joined: 06 Nov 2010
Total Posts: 1058
01 Nov 2011 04:35 PM
The only drawback with that is you have to manually enter the target part in the script.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
01 Nov 2011 04:49 PM
http://wiki.roblox.com/index.php/CFrame
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
08 Nov 2011 03:37 PM
k
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
08 Nov 2011 03:48 PM
k
Report Abuse
Zlavaz is not online. Zlavaz
Joined: 23 Oct 2011
Total Posts: 2722
08 Nov 2011 04:03 PM
Please add "?" so we know it is a question. :)
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
11 Nov 2011 10:26 AM
Wuteva
Report Abuse
mark298 is not online. mark298
Joined: 24 Oct 2008
Total Posts: 1264
11 Nov 2011 11:11 AM
game.Selection:Get()[1].CFrame = game.Selection:Get()[1].CFrame * CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)

-Centre 0's are for slideing brick in which ever way it's facing. Last 0's for rotating.



game.Selection:Get()[1].CFrame = game.Selection:Get()[1].CFrame + Vector3.new(0, 0, 0)

-Slides brick on the Normal Axis.
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