Hi I want to make fireworks that does not only go up but if they fall they go in that direction like normal if a firework falls North it goes North not up or down it goes North i have a model from blender
Try using cframe instead of vector3 , cframe will also use orientation
idk what body thing i have to use like:
-BodyVelocity
-BodyThrust
-BodyPosition
-BodyForce
-BodyAngularVelocity
I only have the model
To make a firework i would recommend BodyVelocity to keep the speed constant.
I am kind of new to moveing models and CFrame
How do i use BodyVelocity and CFrame to make a firework?
local Firework = script.Parent
local BV = Instance.new("BodyVelocity") -- create the instance of bodyvelocity
BV.P = 2000 -- Determines how aggressive of a force is applied in reaching the goal velocity
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge) -- limits the maximum strength.
BV.Velocity = Firework.CFrame.LookVector * 100 -- Take the position where firework is looking.
BV.Parent = Firework -- Sends the BodyVelocity Instance into firework, giving the velocityboost (needs to be unanchored).
probably the firework face is up , try changing to this on BV.Velocity:
(Firework.CFrame * CFrame.Angles(0, math.rad(90), 0)).lookVector * 100
if you go in the wrong direction, just change the axis until you find the correct side of the face
i found out how the script was:
local Firework = script.Parent
local BV = Instance.new("BodyVelocity") -- create the instance of bodyvelocity
local Fire = script.Parent.Light
Fire.MouseClick:Connect(function()
Firework.Anchored = false
wait(0.01)
BV.P = 2000 -- Determines how aggressive of a force is applied in reaching the goal velocity
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge) -- limits the maximum strength.
BV.Velocity = (Firework.CFrame * CFrame.Angles(math.rad(90), 0, 0)).lookVector * 100 -- Take the position where firework is looking.
BV.Parent = Firework -- Sends the BodyVelocity Instance into firework, giving the velocityboost (needs to be unanchored).
end)
1 Like