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
 

Re: Resizing a Part in the Direction of Another Part?

Previous Thread :: Next Thread 
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
20 Jun 2015 04:41 AM
Is it possible to use :Resize() to increase a Part's size (Part1) in the direction of another Part (Part2), and for the end of Part1 to finish resizing when it meets Part2?
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
20 Jun 2015 04:45 AM
Possible.

But too complicated for me to solve D:
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
20 Jun 2015 05:28 AM
Could anybody offer some help or advice as to how I can do this?
It would be greatly appreciated.
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
20 Jun 2015 06:03 AM
Any advice?
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
20 Jun 2015 06:10 AM
you would have to get the different between positions and resize it so.
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
20 Jun 2015 06:16 AM
^Thanks for your help.
Indeed, that is one way of achieving the second-half of my aim, but my main question is, how do I resize a Part in the *direction* of another Part.
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
20 Jun 2015 06:41 AM
I am assuming that these parts are along the same axis?
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
20 Jun 2015 06:49 AM
^Not exactly. I do not have the exact coordinates at hand. As an example, one Part may be at (0,0,0) the other Part at 10.5,1,10.5). In other words, they aren't necessarily on the same axis, nor are they positioned at whole-number positions, meaning that the point on the x-axis of one Part may be 5.96 etc.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
20 Jun 2015 07:19 AM

Take the size and current position.

local p = game.Workspace.Part
local p2 = game.Workspace.Part2

local size = p.Size
local size2 = p2.Size
local pos = p.Position
local pos2 = p2.Position

pos = pos - (size / 2)
pos2 = pos2 - (size2 / 2)

local xislower = pos.X < pos2.X
local yislower = pos.Y < pos2.Y
local zislower = pos.Z < pos2.Z

--TODO: Loop until the two sizes matches adding an increment over time
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
20 Jun 2015 08:06 AM
^Thanks, however I don't think it's the solution I've been searching for.

I might not have been clear enough. I wanted to expand the Part from *one surface only", as one may use :Resize() to do, in the direction of another Part.
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
20 Jun 2015 06:15 PM
You should go into a bit more detail on what exactly you're asking. Most people skim over these posts if they don't understand the question.

So you're trying to use :Resize() to make a part expand one of it's faces towards the direction of another part slowly until it reaches it, but it's not on the same axis?

I don't know any quick way of finding which face of one part is closest to another part except using relative CFrames to move the first part, check its distance from the second part, and then move it back, which probably takes much more script room than necessary. From there you'd be able to find which direction to move the part while resizing a certain axis in order to make it "grow" from a single surface instead of staying in place and simply getting longer.

If that's what you mean to do and your'e not quite sure how, I might be able to help.
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