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 » Scripters
Home Search
 

Rotation Madness

Previous Thread :: Next Thread 
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
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
checkplate is not online. checkplate
Joined: 05 Jan 2016
Total Posts: 1379
22 Jan 2016 06:13 PM
Vest:SetPrimaryPartCFrame(Torso.CFrame)

Rogered.
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
22 Jan 2016 06:13 PM
Nevermind, I figured it out.
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
22 Jan 2016 06:20 PM
Its actually much simpler than that. All I had to do was

Hat1.Rotation = Torso.Rotation
Report Abuse
TheMrRadioActiveMan is not online. TheMrRadioActiveMan
Joined: 11 Dec 2010
Total Posts: 974
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
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
22 Jan 2016 07:29 PM
It works for me... If u dont believe me just look at my game...
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
22 Jan 2016 07:29 PM
It works because of the weld.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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