|
| 02 Oct 2016 02:55 PM |
How would I make a brick have the same rotation as my characters torso?
CFrames seem complicated, kinda of struggled in trig in school. |
|
|
| Report Abuse |
|
|
F18ACE
|
  |
| Joined: 24 Jun 2015 |
| Total Posts: 4025 |
|
|
| 02 Oct 2016 02:56 PM |
| it's not that complicated actually. Do you have the base for the script? i.e. the part that tells the brick to follow in the first place |
|
|
| Report Abuse |
|
|
|
| 02 Oct 2016 02:59 PM |
local primaryPartCFrame = character.PrimaryPart.CFrame local charRot = primaryPartCFrame - primaryPartCFrame.p brick.CFrame = charRot + brick.Position
|
|
|
| Report Abuse |
|
|
|
| 02 Oct 2016 03:01 PM |
This is what I've tried (Probably looks stupid for what I'm trying to do):
while wait() do part.CFrame = part.CFrame * character.Torso.CFrame.Angles end
I know there's a rotational component to a cframe, how do I tack that onto another one? This script doesn't rotate at block at all however it moves oddly. |
|
|
| Report Abuse |
|
|
F18ACE
|
  |
| Joined: 24 Jun 2015 |
| Total Posts: 4025 |
|
|
| 02 Oct 2016 03:06 PM |
part.CFrame = character.Torso.CFrame
this should count for the rotation and position. |
|
|
| Report Abuse |
|
|
|
| 02 Oct 2016 03:08 PM |
| Yes but that would also put it in the same 3d position. Sorry I was unclear in my first post, I would like to rotate another part the same way but in a different location. |
|
|
| Report Abuse |
|
|
|
| 02 Oct 2016 03:11 PM |
Code below (Just tested in studio it works great):
local part = script.Parent local character = game.Players:WaitForChild("Player1").Character
while true do part.Rotation = character.Torso.Rotation wait() end |
|
|
| Report Abuse |
|
|