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 » Scripters
Home Search
 

Offsetting a Part?

Previous Thread :: Next Thread 
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
29 Dec 2015 01:49 PM
Does anybody know how to offset a Part from it's current position?
I know you can do this with a Model using :TranslateBy(), but is there a way of doing it with a Part?

Any help or advise would be greatly appreciated.
Thanks in advance.
Report Abuse
rvox is not online. rvox
Joined: 18 Feb 2011
Total Posts: 5380
29 Dec 2015 01:50 PM
part.CFrame = part.CFrame * CFrame.new(0,1,0)
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
29 Dec 2015 02:02 PM
@rvox

Thanks for that.

It mostly works, however, when I use that technique, the Part appears above other Parts, when it should appear within them.

Perhaps its due to a mistake I've made later in my code.
Any suggestions as to why this happens?
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
29 Dec 2015 02:05 PM
I've looked into it further.
This is the line that causes the Part to appear above other Parts:
HalfPart.Size = Vector3.new(1, HalfPart.Size.Y, HalfPart.Size.Z)


But why?
Can anybody offer any help or advise?
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
29 Dec 2015 02:07 PM
local part = Instance.new("Part", workspace)
part.Anchored = true
local cf = part.CFrame
part.Size = Vector3.new(10,10,10)
part.CFrame = cf


You have to cframe the part after you resize it
Report Abuse
DarthStrantax is not online. DarthStrantax
Joined: 31 May 2011
Total Posts: 2610
29 Dec 2015 02:08 PM
do
local cf=HalfPart.CFrame
HalfPart.Size = Vector3.new(1, HalfPart.Size.Y, HalfPart.Size.Z)
HalfPart.CFrame=cf
end
Report Abuse
mudkip99 is not online. mudkip99
Joined: 17 Jun 2008
Total Posts: 3362
29 Dec 2015 02:09 PM
set the CFrame after you set the size. Setting the size will automatically move the part out of blocks it's within, where CFrame can move parts inside other blocks.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
29 Dec 2015 02:56 PM
If you're creating the part, all you have to do is parent it to workspace AFTER changing the size. When it's not parented to workspace, collisions are not checked.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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