AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 07:16 AM |
So I have a raycasting script, and it works. The problem is that the ray stays verticle between the two parts, and stays in the middle. How can I turn it so that it "connects" to both ends of the parts?
Picture: https://twitter.com/AgentL3r/status/652819771298344961
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 07:17 AM |
script.Parent.Touched:connect(function(hit) if hit.Name == "start" then local p1 = hit local p2 = script.Parent local ray = Ray.new(p2.CFrame.p) local position = workspace:FindPartOnRay(ray, script.Parent, false, false) local hose = Instance.new("Part", hit.Parent) hose.Name = "ext" hose.BrickColor = BrickColor.new("Bright yellow") hose.CanCollide = false hose.Material = "Plastic" hose.Anchored = true hose.FormFactor = "Custom" hose.BackSurface = "Smooth" hose.BottomSurface = "Smooth" hose.FrontSurface = "Smooth" hose.LeftSurface = "Smooth" hose.RightSurface = "Smooth" hose.TopSurface = "Smooth" script.Mesh:Clone().Parent = hose while true do local dis = (p1.Position - p2.Position).magnitude hose.Size = Vector3.new(0.4, dis, 0.4) hose.CFrame = CFrame.new((p1.Position + p2.Position) / 2, p2.Position) wait() end end end)
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 08:14 AM |
b
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 08:29 AM |
b2
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 08:50 AM |
b3
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
| |
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 09:22 AM |
b4
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 09:51 AM |
b5
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 10:17 AM |
b6
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 10:54 AM |
b6
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 10:57 AM |
b7
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 11:11 AM |
b8
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 01:11 PM |
b9
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 01:17 PM |
b10
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 01:37 PM |
b11
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2015 01:38 PM |
ray = Ray.new(start_position,end_position-start_position)
Instance.new("BodyVelocity",SenseiWarrior).velocity = CFrame.new(SenseiWarrior.Torso.Position,YourGirlsDMs.Position).lookVector * 10 |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 01:48 PM |
^ Finally, a reply!
I already added that in my script after I posted this, and unfortunately I have the same problem. Rotation doesn't work.
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2015 01:48 PM |
| @dark Are you dumb? A while loop is not "ew". It is simply a part of Lua. After all, a numeric for loop would be the same. |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2015 01:50 PM |
| its unneccessary here, idiot |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2015 01:50 PM |
| also atay off my turf, your always bothering me |
|
|
| Report Abuse |
|
|
AgentL3r
|
  |
| Joined: 14 Jan 2013 |
| Total Posts: 1671 |
|
|
| 10 Oct 2015 01:52 PM |
b12
#code for i,v in pairs dont |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2015 01:59 PM |
| @dark actually, it is needed to constantly update it. Atleast when you call me an idiot, double check to make sure you wont make a fool of yourself. |
|
|
| Report Abuse |
|
|
morash
|
  |
| Joined: 22 May 2010 |
| Total Posts: 5834 |
|
|
| 10 Oct 2015 02:02 PM |
| p1 and p2 aren't changing and given that everything in the loop is based off of those two values, it's not necessary in any way. You should double check yourself to make sure your not an idiot before making an argument that your not. |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2015 02:02 PM |
But what if they eventually do change?
OHHH I GOT REKT |
|
|
| Report Abuse |
|
|
morash
|
  |
| Joined: 22 May 2010 |
| Total Posts: 5834 |
|
|
| 10 Oct 2015 02:05 PM |
Given that the only reason that they will change is when the event is triggered, what's the point of looping in the event for when they change.
Also for the original problem, try switching the size along with Y-axis with the size along the Z-axis. |
|
|
| Report Abuse |
|
|