Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I make a nuke explosion grow faster?

Asked by 4 years ago
Edited 4 years ago

I have made a script that makes a death block grow I am trying to make it that the speed of it growing is really fast so it simulates a real nuclear explosion.

Here is the script I made:

nuke = script.Parent
pos = nuke.CFrame

while wait() do
    nuke.Size = nuke.Size + Vector3.new(.1,.1,.1)
    nuke.CFrame = pos
    nuke.speed = 100
end 

When I add in the speed part the entire script does not work.

0
Do you realize that you have nuke.CFrame = nuke.CFrame ? Spjureeedd 385 — 4y
0
And speed is no property of a Part. Just change how much it grows from .1 to like .2 or something, It won't look as smooth but it will grow faster Spjureeedd 385 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

the default wait() is capped at around 0.03, so you can't make the wait() quicker there. To add speed isn't a property! However, I suggest using tweening! Tweening in essence is manipulating a part, while making it smooth!

https://developer.roblox.com/en-us/api-reference/function/TweenService/Create

Here's some sample c0de I wrote

local Part = script.Parent

local TweenInformation = TweenInfo.new(
5, --length of tween
Enum.EasingStyle.Back, -- Type of tweening style
Enum.EasingDirection.In, --Direction of tween, whether it goes in, or our, or both!
0, -- how many times it should repeat! (set to a negative value if you want it to go on forever)
false, --If it will reverse when finished
0) --Delay between tweens

local PartProperty = {
Size = Vector3.new(100,100,100); -- size of resulting part
}

local TweenAnimLegit = TweenService:Create(Part,TweenInformation,PartProperty)
TweenAnimLegit:Play()

Happy c0ding B)

1
I don't think it's possible to wait less than 0.03 Spjureeedd 385 — 4y
0
Ah my bad ScriptingNubs 55 — 4y
0
yep, I checked at it's capped at 1/30th (so the default wait()) ScriptingNubs 55 — 4y
Ad

Answer this question