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 » Scripting Helpers
Home Search
 

Data+CFrame to where I look and press

Previous Thread :: Next Thread 
Babyfett1 is not online. 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 is not online. 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 is not online. 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 is not online. 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
IAmTheRolo is not online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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