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
 

Re: CFrame Orientation/Movement Help

Previous Thread :: Next Thread 
lagbuilder is not online. lagbuilder
Joined: 16 Nov 2008
Total Posts: 838
21 Jun 2014 01:07 AM
I have two bricks: Part1 and Part2

I want Part2 to be at the same CFrame it was around Part1 as it was before rotated/moved.

For example, say I rotated Part1 which Part2 was on its front. I want Part2 to go into the same orientation as it was previously and be on the same side.

Is this possible?
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
21 Jun 2014 01:10 AM
while true do
wait(1)
Part1 = game.Workspace.Part1
Part2 = game.Workspace.Part2
Part1.CFrame = CFrame.new(Part2.Position)
end


something like that
Report Abuse
lagbuilder is not online. lagbuilder
Joined: 16 Nov 2008
Total Posts: 838
21 Jun 2014 01:12 AM
That would just set the CFrame of Part1 to the position of Part2..
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
21 Jun 2014 01:14 AM
First off, Scripting Helpers.

Secondly, you're being very vague, and half of what you say doesn't make sense.

Either you're asking for:
local dif = A.CFrame:toObjectSpace(B.CFrame)
A.CFrame = A.CFrame * ? -- change A CFrame
B.CFrame = A.CFrame * dif

Or you're asking for:
local dif = A.CFrame:pointToObjectSpace(B.Position)
A.CFrame = A.CFrame * ? -- change A CFrame
B.CFrame = (B.CFrame - B.CFrame.p) + A.CFrame * dif
Report Abuse
lagbuilder is not online. lagbuilder
Joined: 16 Nov 2008
Total Posts: 838
21 Jun 2014 01:19 AM
Shoot. I'm terribly sorry about that - I was in Scripting Helpers then hit backspace by accident which led me back to the main forum page. I must have quickly looked and thought I clicked Scripting Helpers.

I'm terribly sorry for my mistake..

It's a bit difficult to explain what I'm looking for.

Sorry, and thanks Oysi!
Report Abuse
lagbuilder is not online. lagbuilder
Joined: 16 Nov 2008
Total Posts: 838
21 Jun 2014 01:20 AM
Now I realize why I thought this was Scripting Helpers.. wth has this forum come to with all the spam...

Sorry, and thanks again Oysi!
Report Abuse
dogwarrior24 is not online. dogwarrior24
Joined: 10 Nov 2010
Total Posts: 1401
21 Jun 2014 01:22 AM
This belongs in the Scripting Helpers subforum.


part1 = part
part2 = part2
c1 = part1.CFrame
c2 = part2.CFrame
while wait() do
Offset = Vector3.new(c1.p-c2.p)
p2.CFrame = p1.CFrame +Offset
end
Could make better, but i typed this on a 3DS.
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