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:

1nuke = script.Parent
2pos = nuke.CFrame
3 
4while wait() do
5    nuke.Size = nuke.Size + Vector3.new(.1,.1,.1)
6    nuke.CFrame = pos
7    nuke.speed = 100
8end

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

01local Part = script.Parent
02 
03local TweenInformation = TweenInfo.new(
045, --length of tween
05Enum.EasingStyle.Back, -- Type of tweening style
06Enum.EasingDirection.In, --Direction of tween, whether it goes in, or our, or both!
070, -- how many times it should repeat! (set to a negative value if you want it to go on forever)
08false, --If it will reverse when finished
090) --Delay between tweens
10 
11local PartProperty = {
12Size = Vector3.new(100,100,100); -- size of resulting part
13}
14 
15local TweenAnimLegit = TweenService:Create(Part,TweenInformation,PartProperty)
16TweenAnimLegit: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