So i recently made a Tornado-Type move, im trying to make the nado spin and moves forward at the same time, i script just as how i used to but this time it just doesnt work, can anyone help me to see if anythings wrong??
https://gyazo.com/288930cc138d25bb5d463910adb7f1cf
–script of the nado–
local function nadopart()
local a = workspace.SandNado:Clone()
a.Parent = c
a.Name = “BSNado”
a.Position = c.RightHand.Position
a.CanCollide =false
a.Anchored = true
a.Transparency = 1
a.Size = Vector3.new(1,1,1)
a.Orientation = Vector3.new(0,0,0)
a.CFrame = root.CFrameCFrame.new(0,0,-15)
spawn(function()
wait(.01)a.Transparency = .9 wait(.01)a.Transparency = .8
wait(.01)a.Transparency = .7 wait(.01)a.Transparency = .6
end)
spawn(function()
leavepart(a) --Basically creates a part that’s called “LeftPart”, and the nado follows it, so it
wont change its direction when the player moves around
end)
spawn(function()
for i=1,1000 do
wait(.01)
a.CFrame = a.CFrameCFrame.fromEulerAnglesXYZ(0,5,0)
end
end)
spawn(function()
a.Anchored = false
local bv = Instance.new(“BodyVelocity”,a)
bv.MaxForce = Vector3.new(1e8,1e8,1e8)bv.Velocity = a.LeftPart.CFrame.LookVector20
end)
spawn(function()
for i=1,10 do
wait(.007)a.CFrame = a.CFrameCFrame.new(0,.5,0)
end
end)
spawn(function()
for i=1,10 do
wait(.007)a.Size = a.Size + Vector3.new(1.8,1.8,1.8)
end
end)
spawn(function()
wait(8.7)
a.Transparency = .88 a.Size = a.Size+Vector3.new(6,.6,6)a.Position = a.Position+Vector3.new(0,1,0)
wait(.1)a.Transparency = .92 a.Size = a.Size+Vector3.new(6,.6,6)a.Position = a.Position+Vector3.new(0,1,0)
wait(.1)a.Transparency = .98 a.Size = a.Size+Vector3.new(6,.6,6)a.Position = a.Position+Vector3.new(0,1,0)
wait(.1)a:Destroy()
end)
end
Your problem is that changing the CFrame negates any body thrusts. Where you change the CFrame, you are currently changing the rotation and not changing the position. You need to change the position as part of the CFrame to make it rotate and move. Also, your code is kinda hard to read. Putting ``` before and after makes it the same format as in roblox studio like this:
print("Hi")
i think you meant to type
a.CFrame = root.CFrame * CFrame.new(0,0,-15)
edit: you did this a couple times in there actually
im sorry but i dont quite understand wat u’re saying, u mean that i shouldnt use body velocity? i should just move it forward when it rotates?
yeh ik sorry, this is actually my first post on rbx dev forum, i didnt know that i had to add ``` to make it into code formats, so it deletes all my * marks
no i mean you forgot to multiply the cframes together, you just wrote CFrameCFrame instead of CFrame * CFrame
oh i think its becuz the format i pasted, im 100% sure it was there
local function nadopart()
local a = workspace.SandNado:Clone()
a.Parent = c
a.Name = "BSNado"
a.Position = c.RightHand.Position
a.CanCollide =false
a.Anchored = true
a.Transparency = 1
a.Size = Vector3.new(1,1,1)
a.Orientation = Vector3.new(0,0,0)
a.CFrame = root.CFrame*CFrame.new(0,0,-15)
spawn(function()
wait(.01)a.Transparency = .9 wait(.01)a.Transparency = .8
wait(.01)a.Transparency = .7 wait(.01)a.Transparency = .6
end)
spawn(function()
leavepart(a)
end)
spawn(function()
for i=1,1000 do
wait(.01)
a.CFrame = a.CFrame*CFrame.fromEulerAnglesXYZ(0,5,0)
end
end)
spawn(function()
a.Anchored = false
local bv = Instance.new("BodyVelocity",a)
bv.MaxForce = Vector3.new(1e8,1e8,1e8)bv.Velocity = a.LeftPart.CFrame.LookVector*20
end)
spawn(function()
for i=1,10 do
wait(.007)a.CFrame = a.CFrame*CFrame.new(0,.5,0)
end
end)
spawn(function()
for i=1,10 do
wait(.007)a.Size = a.Size + Vector3.new(1.8,1.8,1.8)
end
end)
spawn(function()
wait(8.7)a.Transparency = .88 a.Size = a.Size+Vector3.new(6,.6,6)a.Position = a.Position+Vector3.new(0,1,0)
wait(.1)a.Transparency = .92 a.Size = a.Size+Vector3.new(6,.6,6)a.Position = a.Position+Vector3.new(0,1,0)
wait(.1)a.Transparency = .98 a.Size = a.Size+Vector3.new(6,.6,6)a.Position = a.Position+Vector3.new(0,1,0)
wait(.1)a:Destroy()
end)
end
i also noticed that you rotate .fromEulerAnglesXYZ(0, 5, 0) in degrees, but it needs to be in radians
you need to do this: .fromEulerAnglesXYZ(0, math.rad(5), 0)
i actually nvr know that, thx for the tip, but that doesnt rlly fix it,
so this is wat i want it to look like
https://gyazo.com/07e588b7ec04d6f86f02a1fa8a05ed96
but after 2-3 attempts this is wat it looks like
https://gyazo.com/6ee0fd4a911613602075d2ec9c25c08e
and this is wat im tryin to solve
hmm i would probably recommend you use cframe the entire time to move it and not use a bodyvelocity at all if it is inconsistent like that