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
 

Re: Welds and Cframe.lookVector

Previous Thread :: Next Thread 
kornawe is not online. kornawe
Joined: 25 Nov 2008
Total Posts: 1272
10 Aug 2011 04:06 PM
I need to make a weld to weld a brick a certain number of studs infront of another brick. I can get the lookVector, but I'm not sure how to turn it into the weld's C1.
Report Abuse
computersRule is not online. computersRule
Joined: 13 Jun 2009
Total Posts: 246
10 Aug 2011 04:49 PM
This is how I would weld a brick 5 studs in front of another with no rotation:

part1 = workspace.Part1 -- Part stays still
part2 = workspace.Part2 -- Part to move in front of part1
parentOfWeld = part1 -- Should always be part1

weld = Instance.new("Weld", parentOfWeld)
weld.Part0 = part1
weld.Part1 = part2
weld.C0 = CFrame.new(part1.CFrame.lookVector*5) -- Change 5 to amout of studs to translate
--print(weld.C0)
Report Abuse
kornawe is not online. kornawe
Joined: 25 Nov 2008
Total Posts: 1272
11 Aug 2011 03:39 PM
I kinda figured, but I didn;t wanna mess it up.
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
11 Aug 2011 03:42 PM
Please :/ don't listen to computer, his script is gonna fail.

part1 = workspace.Part1
part2 = workspace.Part2

weld = Instance.new("Weld", parentOfWeld)
weld.Part0 = part1
weld.Part1 = part2
weld.C1 = CFrame.new(0, 0, 5)
Report Abuse
kornawe is not online. kornawe
Joined: 25 Nov 2008
Total Posts: 1272
12 Aug 2011 03:37 PM
I kinda figured.
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