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: How to rotate a tablet vertically?

Previous Thread :: Next Thread 
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
10 Mar 2013 09:18 AM
function tablet()
for i = 1, 8 do
local p = Instance.new("Part", workspace.Player1)
Instance.new("BodyForce", p).force = Vector3.new(0,0,0)
p.Size = Vector3.new(2,2,2)
p.BrickColor=BrickColor.new("Deep orange")
local fire=Instance.new("Fire",p)
fire.Color=Color3.new(0,0,0)
fire.SecondaryColor=Color3.new(0,0,0)
local sl=Instance.new("SelectionBox",p)
sl.Adornee=p
sl.Color=BrickColor.new(1003)
sl.Visible=true
local m=Instance.new("SpecialMesh",p)
m.MeshId="http://www.roblox.com/asset/?id=1136139" --http://www.roblox.com/asset/?id=9756362
m.MeshType="FileMesh"
local w = Instance.new("Weld", p)
w.Part0 = p.Parent.Torso
w.Part1 = p
w.C0 = CFrame.Angles(0,i/4*math.pi,0) -- How would I CFrame it so that it rotates one angles forward?
w.C1 = CFrame.new(0,0,-6)
end
end
tablet()
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
10 Mar 2013 10:02 AM
How many degrees? 90? 180?

Rotate along the x-axis math.rad(Degrees)

EX: 90 degree rotation = math.rad(90)
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
10 Mar 2013 10:03 AM
Oh, and you'll need to MULTIPLY the C1 CFrame by CFrame.Angles(math.rad(Degrees),0,0). Do not mess with the C0 CFrame.
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
10 Mar 2013 10:49 AM
So would I do this if I wanted it to rotate vertically 45 degrees:

w.C1 = CFrame.new(math.rad(45))
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
10 Mar 2013 12:14 PM
bump
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
10 Mar 2013 01:27 PM
Need agent to help.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
10 Mar 2013 01:57 PM
Read my post again.
You were almost right.
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
10 Mar 2013 03:11 PM
Still don't know howto do it.
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
10 Mar 2013 03:36 PM
I need you to help.
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
11 Mar 2013 02:28 PM
What I have now, but still doesn't work.

function tablet()
for i = 1, 8 do
local p = Instance.new("Part", workspace.Player1)
Instance.new("BodyForce", p).force = Vector3.new(0,0,0)
p.Size = Vector3.new(2,2,2)
p.BrickColor=BrickColor.new("Toothpaste")
local fire=Instance.new("Fire",p)
fire.Color=Color3.new(0,0,0)
fire.SecondaryColor=Color3.new(0,0,0)
local sl=Instance.new("SelectionBox",p)
sl.Adornee=p
sl.Color=BrickColor.new(1003)
sl.Visible=true
local m=Instance.new("SpecialMesh",p)
m.MeshId="http://www.roblox.com/asset/?id=9756362" --http://www.roblox.com/asset/?id=9756362
m.MeshType="FileMesh"
m.Scale=Vector3.new(1.4,1.4,1.4)
local w = Instance.new("Weld", p)
w.Part0 = p.Parent.Torso
w.Part1 = p
w.C0 = CFrame.Angles(0,i/4*math.pi,0) --CFrame.Angles(0,i/4*math.pi,0)
w.C1 = CFrame.new(Vector3.new(math.rad(800,800,800*math.pi,90)))
end
end
tablet()
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
11 Mar 2013 04:29 PM
At least you tried.
You're supposed to MULTIPLY your CFrame.Angles value with the C1 CFrame:



function tablet()
for i = 1, 8 do
local p = Instance.new("Part", workspace.Player1)
Instance.new("BodyForce", p).force = Vector3.new(0,0,0)
p.Size = Vector3.new(2,2,2)
p.BrickColor=BrickColor.new("Deep orange")
local fire=Instance.new("Fire",p)
fire.Color=Color3.new(0,0,0)
fire.SecondaryColor=Color3.new(0,0,0)
local sl=Instance.new("SelectionBox",p)
sl.Adornee=p
sl.Color=BrickColor.new(1003)
sl.Visible=true
local m=Instance.new("SpecialMesh",p)
m.MeshId="http://www.roblox.com/asset/?id=1136139" --http://www.roblox.com/asset/?id=9756362
m.MeshType="FileMesh"
local w = Instance.new("Weld", p)
w.Part0 = p.Parent.Torso
w.Part1 = p
w.C0 = CFrame.Angles(0,i/4*math.pi,0)
w.C1 = CFrame.new(0,0,-6)*CFrame.Angles(math.pi/40,0) --- Multiply
end
end
tablet()
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