How to make a expanding flat circle

I am making a stomp attack for one of the bosses in my game. I want a circle that expands from the boss that the player has to jump over. I have a circle but when i try and resize it in any way with the script, it just turns out very unproportional.

image
Im not sure if i should union it.

1 Like

How are you changing the size? We need all the info we can get to help you.

I do it like this:

local Circle = script.Parent.Parent

for i, v in pairs(Circle:GetChildren()) do
	if v:isA("Part") then
		coroutine.wrap(function()
			for i = 0, 1, .2 do
				v.Size = v.Size + Vector3.new(i, 0, i)
				wait(.5)
			end
		end)()
	end
end

It ends up just becoming a big white blob
image

This is because you are only updating the size. You need to update the size and the position.

You can think of your circle as a collection of points where the parts intersect. If you were to double the size, you would need to simply double the distance between those points and the center. Then resize the parts along one axis to touch both ends again.

I would write out some code to show, but I’m on mobile so that would be take a long time and probably error filled.

I think I know what you want to accomplish as I ran into this issue, or something similar to it, a few months ago. I didn’t find a way to make the circle look equally “good” as it grows bigger, but I made a mesh in Blender and made the size bigger using TweenService.

Here is my result:

Edit: I think doing it with one mesh would be better than multiple parts, but idk if it is even possible with one mesh. Also, I couldn’t really find an example on YouTube or Google of the expanding ring thing.

4 Likes

Sorry its been awhile, but how would I use tween service to do that?

Simply provide thr size property inside the table in the tween and set a size goal. Short example:

--Get TweenService and set TweenInfo


local MeshPart = "YourPart"

local goals = {Size = Vector3.new(5,5,5)}
local Tween = TweenService:Create(MeshPart, Info,goals)
Tween:Play()
1 Like

I made this just a very simple script

local MeshPart = script.Parent.Union

local goals = {Size = Vector3.new(5,5,5)}
local tweenInfo = TweenInfo.new(5)
local Tween = game:GetService("TweenService"):Create(MeshPart, tweenInfo,goals)
Tween:Play()

but it gets smaller idk why

What is the size of it before doing any tweening?

Im not sure why this would matter, but i have an image of the size

The goal of a tween is the end. So when a tween is done playing the size will be equal to 5,5,5. (based on the code further above.) This is smaller than 20.857,1.006, 20.856 so that is why it looks like it is getting smaller.

Try making the goal bigger, something like 40,2,40.

Edit: The link to the tween service API could be helpful:
https://developer.roblox.com/en-us/api-reference/class/TweenService
(The bottom of the link has code examples and stuff.)

It’s getting smaller because you set it’s new size to 5,5,5, when it’s standard size is 20,1,20~ roughly.

I would suggest you save the standard size, so we can multiply the size

local TweenService = game:GetService("TweenService")
local MeshPart = script.Parent:WaitForChild("Union")

local MultipliedSize = 3

local SavedSize = MeshPart.Size
local Tween = TweenService:Create(MeshPart,TweenInfo.new(5),{Size = Vector3.new(SavedSize.X*MultipliedSize,SavedSize.Y,SavedSize.Z*MultipliedSize)})
Tween:Play()

This works, but when I dont change the Y axis, nothing moves. But if I do change the y axis, it will become impossible to jump over, because the map is kinda big.

Could you show me a short video of what’s going on, and also attach the script in the reply? :slight_smile:

Edit: Updated the script above, forgot to add “:Create”, so we creat the tween, and then I also forgot to add a “)” at the end.

robloxapp-20220514-2143155.wmv (364.8 KB) - Video of the tween effect in action. I multiplied size by 5 in this case.

But if your ring starts really small, then the multiplied size would need to be in the 100’s or 1000’s - But it does not effect performance at all that we multiply it by that much, it’s simple math. :slight_smile:

Sorry it was awhile, when i use that scipt would work, but it is a union so when I try to change only the x and z axis, it wont move, it will only size if I change the Y axis too. How would I do this with multiple parts?

You cannot change size of a union the same way you can with a part or meshpart, a union acts like a model will, if you tried to scale it. Go make a ring in blender and import it to studio as a meshpart. :slight_smile:

Here, I made you a fancy ring
Ring.obj (30.8 KB)