|
| 22 Jan 2016 06:12 PM |
I have a script that I made, it copies and welds a vest based on teamcolor to the players torso. Everytime the player spawns, its lopsided. How can I change the rotation of an object based on the player's torso rotation? I define Torso earlier in the script as the torso of the player.
if player.TeamColor == BrickColor.new(TeamColor1)then local Hat1 = Storage:WaitForChild("Vest2"):Clone() Hat1.Parent = player.Character Hat1.Position = Torso.Position --Something like Hat1.Rotation = Torso.Roation?
local weld = Instance.new("ManualWeld", Hat1) weld.Part0 = Hat1 weld.Part1 = Torso
weld.C0 = Hat1.CFrame:inverse() * Torso.CFrame
end |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2016 06:13 PM |
Vest:SetPrimaryPartCFrame(Torso.CFrame)
Rogered. |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2016 06:13 PM |
| Nevermind, I figured it out. |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2016 06:20 PM |
Its actually much simpler than that. All I had to do was
Hat1.Rotation = Torso.Rotation |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2016 06:58 PM |
| That just makes the game lag? the Rotation only gets set once. Meaning everytime the person turns it needs to be re-updated. Really quickly so you don't get any lag of the torso moving. That is performance garbage. |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2016 07:29 PM |
| It works for me... If u dont believe me just look at my game... |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2016 07:29 PM |
| It works because of the weld. |
|
|
| Report Abuse |
|
|