hansotto
|
  |
| Joined: 21 Apr 2010 |
| Total Posts: 233 |
|
|
| 04 Mar 2014 11:31 AM |
I wan't a Brick to have the same angles as my Torso, what's wrong with this line??
gearmain.CFrame = CFrame.new(0,0,0) * Torso.CFrame.Angles
("Torso" is a variable) |
|
|
| Report Abuse |
|
|
LemmJuice
|
  |
| Joined: 23 Feb 2014 |
| Total Posts: 866 |
|
|
| 04 Mar 2014 11:33 AM |
Where is Torso coming from? you have to do something like:
workspace.Player1.Torso.CFrame.Angles
--and for gearmain
workspace.gearmain.CFrame |
|
|
| Report Abuse |
|
|
LemmJuice
|
  |
| Joined: 23 Feb 2014 |
| Total Posts: 866 |
|
|
| 04 Mar 2014 11:34 AM |
| Sorry, Just realized at the bottom you said Torso is a variable, but make sure when you declare the variable it uses the same method |
|
|
| Report Abuse |
|
|
hansotto
|
  |
| Joined: 21 Apr 2010 |
| Total Posts: 233 |
|
|
| 04 Mar 2014 11:37 AM |
This is just one line in my script, here is the full script
--[Credits to hansotto for making this]--
Player = game.Players.hansotto Character = Player.Character Torso = Character.Torso
--[Gear]-- local gearmain = Instance.new("Part", Workspace) gearmain.Position = Torso.Position + Vector3.new(0,6,0) gearmain.CFrame = CFrame.new(0,0,0) * Torso.CFrame.Angles gearmain.Size = Vector3.new(2,2,1) gearmain.TopSurface = "Smooth" gearmain.BottomSurface = "Smooth" gearmain.Anchored = true gearmain.Name = "Gear" ----------
--[MainLoop]--
while true do Workspace.Gear.Position = Torso.Position + Vector3.new(0,6,0) wait() ends
-------------- |
|
|
| Report Abuse |
|
|
LemmJuice
|
  |
| Joined: 23 Feb 2014 |
| Total Posts: 866 |
|
|
| 04 Mar 2014 11:40 AM |
| Are you trying to get it in the middle? if not, it's this "CFrame.new(0,0,0)", change it to "CFrame.new(Torso.CFrame.p)". |
|
|
| Report Abuse |
|
|
|
| 04 Mar 2014 11:42 AM |
to get it to be rotated in the same direction
thing.CFrame = CFrame.new(Torso.Rotation) |
|
|
| Report Abuse |
|
|
hansotto
|
  |
| Joined: 21 Apr 2010 |
| Total Posts: 233 |
|
| |
|
|
| 04 Mar 2014 11:46 AM |
| nvm what I said,i made a huge mistake.. |
|
|
| Report Abuse |
|
|
|
| 04 Mar 2014 11:47 AM |
rot = Workspace.Part2.Rotation Workspace.Part.CFrame = CFrame.new(0,2,0)*CFrame.Angles(math.rad(rot.X),math.rad(rot.Y),math.rad(rot.Z)) |
|
|
| Report Abuse |
|
|
LemmJuice
|
  |
| Joined: 23 Feb 2014 |
| Total Posts: 866 |
|
|
| 04 Mar 2014 11:49 AM |
@hansotto
CFrame.p returns the position in a Vector3 I believe, if you just did "CFrame.new(Torso.CFrame)" it would cause an error since it's a CFrame in a CFrame and want to CFrame a Vector3.
Or you could just do "gearmain.CFrame = Torso.CFrame" |
|
|
| Report Abuse |
|
|
hansotto
|
  |
| Joined: 21 Apr 2010 |
| Total Posts: 233 |
|
|
| 04 Mar 2014 11:51 AM |
So "gearmain.CFrame = Torso.CFrame" will make the brick spin around itself when I spin around myself?
|
|
|
| Report Abuse |
|
|
LemmJuice
|
  |
| Joined: 23 Feb 2014 |
| Total Posts: 866 |
|
| |
|
|
| 04 Mar 2014 12:00 PM |
why doesn't anyone ever use welds..??
w = Instance.new("Weld",gearmain) w.Part0 = w.Parent w.Part1 = Torso w.C0 = CFrame.new(0,0,-1)*CFrame.new(0,0,math.pi) |
|
|
| Report Abuse |
|
|
LemmJuice
|
  |
| Joined: 23 Feb 2014 |
| Total Posts: 866 |
|
|
| 04 Mar 2014 12:01 PM |
| Because might not want it to be attached to the player, maybe just having the same angles as the player... |
|
|
| Report Abuse |
|
|
hansotto
|
  |
| Joined: 21 Apr 2010 |
| Total Posts: 233 |
|
|
| 04 Mar 2014 12:02 PM |
It works, but whenever i run it, it makes two blocks? why??
--[Credits to hansotto for making this]--
Player = game.Players.hansotto Character = Player.Character Torso = Character.Torso
--[Gear]-- local gearmain = Instance.new("Part", Workspace) gearmain.Position = Torso.Position + Vector3.new(0,6,0)
gearmain.Size = Vector3.new(2,2,1) gearmain.TopSurface = "Smooth" gearmain.BottomSurface = "Smooth" gearmain.Anchored = true gearmain.Name = "Gear" ----------
--[MainLoop]--
while true do Workspace.Gear.Position = Torso.Position + Vector3.new(0,6,0) gearmain.CFrame = Torso.CFrame wait() end
-------------- |
|
|
| Report Abuse |
|
|
hansotto
|
  |
| Joined: 21 Apr 2010 |
| Total Posts: 233 |
|
| |
|