|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 24 Jan 2016 07:27 PM |
| part1.CFrame = CFrame.new(part1.Position,part1.Position+part2.CFrame.lookVector) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 24 Jan 2016 07:38 PM |
Bump
This is really difficult for me, idk why. anyone??? anything??? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 24 Jan 2016 08:06 PM |
| And yours did not work well at all. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2016 08:07 PM |
https://gyazo.com/eecf7c84be6800ef58024f3770c514f8
Results of using your CFraming ^^^ |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|