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 help!

Previous Thread :: Next Thread 
Techante is not online. Techante
Joined: 17 Oct 2011
Total Posts: 2101
19 Jun 2014 11:18 AM
for y = y, y+10, 1 do
script.Parent.Position = Vector3.new(0, y, 0)
wait(1)
end

This won't work, I want the brick to move up 10 studs, no matter what height it is at originally.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
19 Jun 2014 11:19 AM
for y = 1, 10 do --leaving the third argument empty will have it as 1
script.Parent.CFrame = CFrame.new(0, y, 0) --use cframe so that it would go through objects
wait(1)
end
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
19 Jun 2014 11:20 AM
for y = 1, 10 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, y, 0)
wait(1)
end

--forgot something, use this script instead
Report Abuse
TradeDEV is not online. TradeDEV
Joined: 15 Jun 2014
Total Posts: 299
19 Jun 2014 11:21 AM
b = Workspace.Part

for y = 1, 10 do
b.CFrame = CFrame.new(0,y,0)
wait(1)
end


@TradeDEVRBLX
Report Abuse
Techante is not online. Techante
Joined: 17 Oct 2011
Total Posts: 2101
19 Jun 2014 11:22 AM
I was going to say that that wouldn't work xD Anyway, thanks :P I did change it to CFrame, I did that at first and it didn't work, and then I realised I did CFrame3.new when it should have just been CFrame.new.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
19 Jun 2014 11:23 AM
you needed this too

part.CFrame =
part.CFrame * --this
CFrame.new()

or else it wouldnt go up from where it was originally
Report Abuse
TradeDEV is not online. TradeDEV
Joined: 15 Jun 2014
Total Posts: 299
19 Jun 2014 11:25 AM
Wouldn't it be added not multiplied?

@TradeDEVRBLX
Report Abuse
Techante is not online. Techante
Joined: 17 Oct 2011
Total Posts: 2101
19 Jun 2014 11:25 AM
Ok, but I want it to go up 0.2 studs each time, how do I do that then, cause this won't work:

for y = 1, 100, 0.2 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, y, 0)
wait(0.5)
end
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
19 Jun 2014 11:26 AM
You cant add using CFrame, only subtracting, dividing, and multiplying.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
19 Jun 2014 11:27 AM
for y = 1, 10 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, y/5, 0) --y/5 instead of y
wait(0.5)
end
Report Abuse
TradeDEV is not online. TradeDEV
Joined: 15 Jun 2014
Total Posts: 299
19 Jun 2014 11:29 AM
My apologies I was thinking about CFrames's and Vector3's

@TradeDEVRBLX
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