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: CFraming by adding or subtracting from coordinates

Previous Thread :: Next Thread 
Firewarrior321 is not online. Firewarrior321
Joined: 09 Dec 2011
Total Posts: 3443
27 Jan 2014 02:10 PM
Normally I would use a script that designates the coordinates I want a brick to go to:

p = script.Parent.Parent.MisterBrick
function onClicked()
p.CFrame = CFrame.new(0,0,0)
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

But is there a simpler way, such as adding to or subtracting from coordinates?
For example, something like this:

p.CFrame = CFrame.new(X-2, Y+5) --Z stays the same

Is anything like this possible?
It would be nice to copy and paste CFramed doors without having to re-script them.
Report Abuse
Firewarrior321 is not online. Firewarrior321
Joined: 09 Dec 2011
Total Posts: 3443
27 Jan 2014 02:18 PM
Bump....
Report Abuse
Firewarrior321 is not online. Firewarrior321
Joined: 09 Dec 2011
Total Posts: 3443
27 Jan 2014 03:41 PM
Bump...
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
27 Jan 2014 03:44 PM

p.CFrame = p.CFrame * CFrame.new(-2,5,0)
Report Abuse
Firewarrior321 is not online. Firewarrior321
Joined: 09 Dec 2011
Total Posts: 3443
27 Jan 2014 05:07 PM
Thanks.
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