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
 

CFrame help? I'm just confusing myself at this point

Previous Thread :: Next Thread 
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
06 Jan 2017 07:40 PM
local P1 = script.Parent.Base

local Parts = script.Parent.Model:GetChildren()

for i = 1, #Parts do
local P2 = script.Parent.Model[i]
P2.CFrame = P1.CFrame
* CFrame.Angles(0, ((math.rad(360/#Parts) * i) - math.rad(360/#Parts)) + math.rad(180), 0)
* CFrame.new(-45, 10.98, 0)
* CFrame.new(P1.CFrame.lookVector * 10, 0, 0)

end


lookVector isn't working or I'm messing it up.

When I uploaded the meshes I didn't fix them properly so they're rotated wrongly relative to the part, so I have to rotate the parts around to face the main part's RightSurface.
I'm ok with that, but this lookVector thing just doesn't wanna work.
No matter what number I set it to they just won't budge.
Report Abuse
GonnaW is not online. GonnaW
Joined: 10 Oct 2016
Total Posts: 3853
06 Jan 2017 08:13 PM
try lookVector * 10 instead of 10,0,0


https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=170052312
Report Abuse
ExtremeBuilder15 is online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
06 Jan 2017 08:16 PM
I'm not sure what you're doing, multiplying CFrames, but

local P2 = Parts[i] will make them go do it.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
06 Jan 2017 08:18 PM
Oh yeah... I'm not supposed to put it into the Vector3. How silly of me lol
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
06 Jan 2017 08:23 PM
local P1 = script.Parent.Base

local Parts = script.Parent.Model:GetChildren()

for i = 1, #Parts do
local P2 = script.Parent.Model[i]
P2.CFrame = P1.CFrame
* CFrame.Angles(0, ((math.rad(360/#Parts) * i) - math.rad(360/#Parts)) + math.rad(180), 0)
* CFrame.new(-45, 10.98, 0)
+ P1.CFrame.rightVector * -14.2

end


That fixed it lmao...
Now for the tremendously long and arduous process of resizing and aligning everything by hand now that they're positioned properly.

That's what I get for using multiple meshes lol
Report Abuse
GonnaW is not online. GonnaW
Joined: 10 Oct 2016
Total Posts: 3853
06 Jan 2017 08:26 PM
Your script confuses me
What are you even trying to do?



https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=170052312
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