Babyfett1
|
  |
| Joined: 02 Apr 2011 |
| Total Posts: 141 |
|
|
| 06 Aug 2014 02:19 PM |
Hello. I am a good (and basic-ish) scripter. If you've ever heard of Attack on Titan, you might know what I want to make, Three dimensional maneuver gear. I am trying to make a script so basically, If I press Q or E at it, it'll create a block CFramed at it. I know like I could do: Instance.new("Model",game.Workspace) game.Workspace.Model.Name="wires" and if they press Q, It'll spawn a block with Instance.new("Part",game.Workspace.wires) Well I want it to also be able to set the length of the block as the distance between me and where I look at and press Q. Any help would be awesome. |
|
|
| Report Abuse |
|
|
Fir3bl4ze
|
  |
| Joined: 13 Jul 2012 |
| Total Posts: 310 |
|
|
| 06 Aug 2014 02:43 PM |
http://wiki.roblox.com/index.php?title=Raycasting |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Aug 2014 03:04 PM |
| You don't even need raycasting for this. |
|
|
| Report Abuse |
|
|
Babyfett1
|
  |
| Joined: 02 Apr 2011 |
| Total Posts: 141 |
|
|
| 06 Aug 2014 05:03 PM |
| Well cntkillme I'd love to know what you DO need for this. |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2014 05:14 PM |
local endpos = mouse.Hit.p local dist = (startpos-endpos).magnitude local part = Instance.new("Part",workspace) part.FormFactor = "Custom" part.Anchored = true part.CanCollide = false part.Size = Vector3.new(1,1,dist) part.CFrame = CFrame.new(endpos,startpos)*CFrame.new(0,0,-dist/2)
That's how you create the part. You define startpos and mouse. |
|
|
| Report Abuse |
|
|