so im making a skill and im trying to figure out how to make the block fly out in the sky like in this image. But im not sure how to, how would i make the rocks fly out
Create a new BodyVelocity instance to the rock that you want to fly, then set the velocity’s Y level to a high number. Make sure to also make the rock unanchored.
you could create a bodyvelocity like Downrest mentioned, or you could use :ApplyImpulse() using the parts’ LookVector * a large number
so i tried both and im not really good at bodyvelocity so it didn’t work. I did use the applyimpulse function and it worked but the block just goes straight up, how would i make it go to the side. Btw i used upvector instead of lookvector.
nvm figured it out ty for the help
oh wait how would i send the block in any direction?
changing the assemblyangularvelocity using math.random() before you change the upvector would make the part fly in a random direction
im not really sure how to use assemblyangularvelocity
part.AssemblyAngularVelocity = Vector3.new(math.random(10000,10000),math.random(10000,10000),math.random(10000,10000))
would it be something like this?
You could just do a for loop on the amount of blocks, like so;
for i = 1, 8 do
local part = Instance.new("Part")
part.Size = Vector3.new(2, 2, 2)
part.Parent = workspace
part.CFrame = SOMEPLACE.CFrame -- Change SOMEPLACE to wherever it spawns
part.CanCollide = true
part.Velocity = Vector3.new(math.random(1, 10),math.random(50, 100), math.random(1, 10))
part.RotVelocity = Vector3.new(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5))
task.wait(1)
end
it’s working but like it’s going in one direction
You could edit this line here for a different and more random outcome;
part.RotVelocity = Vector3.new(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5))
You could also edit the line above it for more power to the blast of rocks,
part.Velocity = Vector3.new(math.random(1, 10),math.random(50, 100), math.random(1, 10))
make sure your parts are not anchored, cancollide is off and they are massless as mass will quickly cause the parts velocity to decelerate to 0,0,0
part.Velocity = Vector3.new(math.random(1,yournumber),math.random(1,yournumber),math.random(1,yournumber))
In this you have the math.random pick a random number from 10000 to 10000, which means it’s going to be 10000, I would change it to something like math.random(-1000,1000) except for the Y value, you would want to keep that above 0
I would not recommend using this since Velocity and RotVelocity are deprecated, as stated in the Velocity article and in the RotVelocity article
Umm change the .Velocity vector3 in the xz axis to math.random(10,-10)
doesn’t spread out
Could you show what the code looks like?
Deprecated doesn’t mean it won’t work. It just means it’s no longer supported. This doesn’t mean he can’t still use it to achieve his goals.
In my opinion deprecated makes it seem like it’s unusable, sorry for being dumb lol.
Its a psudo code
for i = 1, 8 do
local part = Instance.new("Part")
part.Size = Vector3.new(2, 2, 2)
part.Parent = workspace
part.CFrame = SOMEPLACE.CFrame -- Change SOMEPLACE to wherever it spawns
part.CanCollide = true
part:ApplyImpulse(Vector3.new(math.random(-10, 10),math.random(50, 100), math.random(-10, 10)))
part.RotVelocity = Vector3.new(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5))
task.wait(1)
end