BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 07:19 PM |
local length = 1000 local sp = script.Parent local hit, pos = workspace:FindPartOnRay(Ray.new(script.Parent.Position,((script.Parent.Position+script.Parent.CFrame.lookVector)-script.Parent.Position).unit*length)) if hit ~= nil then print(hit) a = hit:Clone() a.Parent = Game.Workspace a.Anchored = true a.Position = Vector3.new(hit.Position.X,hit.Position.Y,math.floor(sp.Position.Z-hit.Position.Z)) if a.Position.Z > sp.Position.Z then a:Destroy() end end if hit == nil then print("No part to reflect found!") end if hit.Parent:IsA("Model") then b = hit.Parent:FindFirstChild("Head") b1 = hit.Parent:FindFirstChild("Torso") b2 = hit.Parent:FindFirstChild("Left Arm") b3 = hit.Parent:FindFirstChild("Right Arm") b4 = hit.Parent:FindFirstChild("Left Leg") b5 = hit.Parent:FindFirstChild("Right Leg") b:Clone() b1:Clone() b2:Clone() b3:Clone() b4:Clone() b5:Clone() b.Anchored = true b1.Anchored = true b2.Anchored = true b3.Anchored = true b4.Anchored = true b5.Anchored = true b.Parent = Game.Workspace b1.Parent = Game.Workspace b2.Parent = Game.Workspace b3.Parent = Game.Workspace b4.Parent = Game.Workspace b5.Parent = Game.Workspace b.Position = Vector3.new(b.Position.X,b.Position.Y,math.floor(sp.Position.Z-b.Position.Z)) b1.Position = Vector3.new(b1.Position.X,b1.Position.Y,math.floor(sp.Position.Z-b1.Position.Z)) b2.Position = Vector3.new(b2.Position.X,b2.Position.Y,math.floor(sp.Position.Z-b2.Position.Z)) b3.Position = Vector3.new(b3.Position.X,b3.Position.Y,math.floor(sp.Position.Z-b3.Position.Z)) b4.Position = Vector3.new(b4.Position.X,b4.Position.Y,math.floor(sp.Position.Z-b4.Position.Z)) b5.Position = Vector3.new(b5.Position.X,b5.Position.Y,math.floor(sp.Position.Z-b5.Position.Z)) end
This sort of works however, when ever I get in front of the mirror part and set the script inside it to disabled to false it clones me but it kills me :/
What seems to be the problem? |
|
|
| Report Abuse |
|
|
Lapwn
|
  |
| Joined: 03 Jun 2012 |
| Total Posts: 5975 |
|
|
| 23 Oct 2013 07:21 PM |
| I dont know mabey a:Destroy() on line 12 or something |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
| |
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
| |
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
| |
|
|
| 23 Oct 2013 07:39 PM |
| Wait does this make a working mirror because if it does i want one!!! |
|
|
| Report Abuse |
|
|
Lapwn
|
  |
| Joined: 03 Jun 2012 |
| Total Posts: 5975 |
|
|
| 23 Oct 2013 07:40 PM |
| @row the script is right in front of you .-. |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 07:42 PM |
| Well its not an actual reflection but its something quite similar to what a mirror does(You can call this a mirror simulator.) And there are lots of bugs and glitches. |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2013 07:43 PM |
| SO it makes a working mirror cool! |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 07:44 PM |
I guess :/
But its not ready so much stuff left to do. |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 07:45 PM |
| but don't call it a mirror. |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 07:48 PM |
| And it currently works only with a mirror the size of (5, 5, 1) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Oct 2013 07:49 PM |
That's more of a character "rotate"
If you want an actually mirror, you could just get all parts from, an angle if 120 or so respective to the lookVector of the mirror and rotate all found objects by math.pi and "place" them on the mirror |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 07:51 PM |
| I never thought of that xP |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 07:51 PM |
| But how would I get all the parts from an angle? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Oct 2013 07:55 PM |
| multiple raycasts could work |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Oct 2013 07:58 PM |
Meh, kind of. There are better ways |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
| |
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 08:00 PM |
| How about multiple mirrors? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Oct 2013 08:03 PM |
| Actually, you can probably use atan2 for all parts in it's lookVector to get the angle of each |
|
|
| Report Abuse |
|
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 08:03 PM |
| What is the atan2 you speak of? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
BruceAB12
|
  |
| Joined: 19 Jan 2012 |
| Total Posts: 3238 |
|
|
| 23 Oct 2013 08:08 PM |
| I searched it in the wiki. Nothing showed up. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|