Hello, I’m working on my free release and I got this problem. How I can resize part on one side.
Example
Example is only oppening compartment door.
I tried to make this and it resizeon both sides. Thank you anyone who helps.
Hello, I’m working on my free release and I got this problem. How I can resize part on one side.
Example
Example is only oppening compartment door.
I tried to make this and it resizeon both sides. Thank you anyone who helps.
try moving it to counter the size
You would also have to Tween the part to stay at the same position, so it doesn’t move away. Again, haven’t done it before, but let me know if it works out for you.
I edited the post, It is only compartment door.
Can you explain more of what you said.
so like
if ur reducing the size X of a part by 1
u have to move the parts X position by either -0.5 or 0.5 depending which side it goes
so once the part resized on both sides you move it to create the illusion of only resizing in one side
Alright, I will try that and see if it works.
Try this:
function adjust(part, NewLength)
if math.max(NewLength, part.Size.Y) == NewLength then
part.Position = part.Position - Vector3.new(0, math.abs(part.Size.Y - NewLength) / 2, 0)
else
part.Position = part.Position + Vector3.new(0, math.abs(part.Size.Y - NewLength) / 2, 0)
end
end
this is the script to do it. This worked for me.
This is for Y only. ok this is for only y not z either.
I will try, thanks for responding.
This works for the Y axis only. All you need to do is change some of the values to make it work for all axis.
Also, I have a question. What do you put as “NewLength” ?
Instead, try looking at this function, it looks like it matches what you need.
New Length is what you want the size to be. A number. Not a vector3.