So in my game you should be able to throw firework but everytime I try to set the MaxVelocity of the LinearVelocity the error comes.
The Code:
local FireworkIndex = {
["BundleOfFirework"] = {
FullName = "Bundle Of Firework",
Model = GameAssets.Firework.BundleOfFirework,
MaxVel = 10000,
Vel = 5000
}
}
-- Throw code:
FireFirework:Connect(function(Player: Player, LookVector: Vector3)
local Char = Player.Character
if Char then
local Root = Char:FindFirstChild("HumanoidRootPart")
if Root then
local Firework = FireworkIndex["BundleOfFirework"]
local Model = Firework.Model:Clone()
Model.PrimaryPart.CFrame = Root.CFrame + Root.CFrame.LookVector -- Ignore this
Model.PrimaryPart.CFrame = CFrame.lookAt(Model.PrimaryPart.Position, LookVector) -- and this please
Model.Parent = workspace
Model.PrimaryPart.Velocity.MaxForce = Firework.MaxVel -- Error comes from here
Model.PrimaryPart.Velocity.VectorVelocity = Root.CFrame.LookVector * Firework.Vel
end
end
end)
Are you using a LinearVelocity or something else? Also, correct me if I’m wrong but I’m pretty sure that the VectorVelocity property is a Vector3 type.
Oh right. I’m not sure what could be the problem. For now, maybe try putting them in a pcall and warning out the result?
(Though I think it’d just warn the error instead)
I just tried changing the max force through the command bar and it worked, so I literally have no idea what could be causing the problem. Probably another Roblox thing.