(This is kinda hard to explain so read the description) :Clone() cloning things twice?
Asked by
4 years ago Edited 4 years ago
I'm making a mode for one of my classes in my game. I got all the effects done but for the shockwave effect, it clones itself twice and the first clone goes away but the 2nd clone stays.
Heres a video showing what it does: https://www.youtube.com/watch?v=1XrUu2flUTQ&feature=youtu.be&ab_channel=DankDesmondo
Heres my code
01 | local Shockwave = game.ServerStorage:WaitForChild( "Shockwave" ):Clone() |
02 | Shockwave.CFrame = Humrp.CFrame |
03 | Shockwave.Parent = Character |
06 | goal.Size = Shockwave.Size + Vector 3. new( 20 , 11.97 , 20 ) |
07 | goal.Orientation = Vector 3. new( 0 , 360 , 0 ) |
08 | local info = TweenInfo.new( 2 , Enum.EasingStyle.Linear,Enum.EasingDirection.Out) |
09 | local tween = TweenService:Create(Shockwave,info,goal) |
13 | goal.Orientation = Shockwave.Orientation + Vector 3. new( 0 , 3600 , 0 ) |
14 | local info = TweenInfo.new( 7 , Enum.EasingStyle.Linear,Enum.EasingDirection.Out) |
15 | local tween = TweenService:Create(Shockwave,info,goal) |
19 | local tInfo = TweenInfo.new( 4 ,Enum.EasingStyle.Linear,Enum.EasingDirection.Out) |
20 | local tween = game:GetService( "TweenService" ):Create(Shockwave,tInfo, { Transparency = 1 } ) |
wait(7)
Shockwave:Destroy()
Edit: Ok so I fixed it. Theres a REALLY weird thing happening where if you don't destroy right after it was made, this glitch happens, so basically I just needed to destroy it earlier in the code