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 Angles/Rotation

Previous Thread :: Next Thread 
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 06:58 PM
Okay, so say I have two parts. One part is on an angle/rotated a bit and the other one is just normal. How can I make the second part the same rotation as the first part but not with Vector3 instead I want to use CFrame. How????
Report Abuse
ColonySimulator is not online. ColonySimulator
Joined: 05 Jul 2015
Total Posts: 1721
24 Jan 2016 07:00 PM
I'm not sure but i think that with CFrame.Angles you will need exactly the x , y and z coord so you could maybe try

CFrame.Angles(thing.Rotation.Y,thing.Rotation.Y,thing.Rotation.Z)
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 07:01 PM
Didn't work :(
Report Abuse
ColonySimulator is not online. ColonySimulator
Joined: 05 Jul 2015
Total Posts: 1721
24 Jan 2016 07:05 PM
CFrame.lookVector but it vector so :/ btw why you dont wanna use Vector3 ? It easy to use?
Report Abuse
rvox is not online. rvox
Joined: 18 Feb 2011
Total Posts: 5380
24 Jan 2016 07:07 PM
local part1
local part2

part1.CFrame = CFrame.new(part1.Position) * (part2.CFrame-part2.CFrame.p)

Part1 is the part with no rotation
Part2 is the part with your rotation
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 07:16 PM
I'm not using Vector3 because I'm creating a "mirror" and to correctly imitate a players position and rotation, I can't use Vector3 because it won't allow any parts to go through other parts causing a lot of glitchiness. CFrame works perfectly, but the rotation is difficult.
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 07:26 PM
bump
Report Abuse
0supadude0 is not online. 0supadude0
Joined: 11 Aug 2010
Total Posts: 649
24 Jan 2016 07:27 PM
part1.CFrame = CFrame.new(part1.Position,part1.Position+part2.CFrame.lookVector)
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 07:33 PM
Children[i].CFrame = CFrame.new((Model2:FindFirstChild(Children[i].Name).Position * Vector3.new(-1, 1, 1)),Children[i].Position + Model2:FindFirstChild(Children[i].Name).CFrame.lookVector * Vector3.new(-1,1,1))

That's my line of code that copies the other parts CFrame (It's just a line from a bigger chunk)

This is what happens after it all runs:

https://gyazo.com/df910f17e656302e7dea5407acf9ec9f
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 07:38 PM
Bump

This is really difficult for me, idk why. anyone??? anything???
Report Abuse
0supadude0 is not online. 0supadude0
Joined: 11 Aug 2010
Total Posts: 649
24 Jan 2016 07:43 PM
* Vector3.new(-1, 1, 1)
What is the purpose of that

Also I don't think you quite copied it over properly

Children[i].CFrame = CFrame.new(Children[i].Position, Children[i].Position + Model2:FindFirstChild(Children[i].Name).CFrame.lookVector)
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 08:05 PM
Vector3.new(-1,1,1) is where the "mirror" is. The area where you and the reflection meet.
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 08:06 PM
And yours did not work well at all.
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 08:07 PM
https://gyazo.com/eecf7c84be6800ef58024f3770c514f8

Results of using your CFraming ^^^
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 08:24 PM
welp this is tragic LMAO
Report Abuse
0supadude0 is not online. 0supadude0
Joined: 11 Aug 2010
Total Posts: 649
24 Jan 2016 08:29 PM
If the reflection in the mirror is going to stay in one place, it shouldn't be too difficult for you to script a reflection, but I would use toObjectSpace to do that rather than manual positioning/copying a rotation:
http://wiki.roblox.com/index.php?title=CFrame&redirect=no#Methods

If you're wanting the mirror to be realistic and have the image move 'properly' according to the object, you'll have to do a lot more work/research into mirroring
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
24 Jan 2016 08:33 PM
nice try nancy drew but ive done this before without using ObjectToWorld thing and its worked out perfectly i'm just missing something and I can't remember it.
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