Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to set fire's Position?

Asked by 3 years ago

Hey! I am making a game, and I am working on a part that needs fire. The only problem is when I do 'fire.Position = Vector3.new(x, y, z)' it says, Position is not a valid member of Fire "Workspace.Fire" This is the exact code:

script.Parent.ClickDetector.MouseClick:Connect(function()
    local fire = Instance.new("Fire",workspace)
    fire.Position = Vector3.new(35.901, 1.9, -35.233)
    local fire2 = Instance.new("Fire",workspace)
    fire2.Position = Vector3.new(35.901, 1.9, -32.433)
    wait(1)
    fire:Destroy()
    fire2:Destroy()
end)

Thanks in advance!

1 answer

Log in to vote
0
Answered by 3 years ago

Fire is an effect that is applied to any BasePart. As such, it does not have any Position property, that is controlled by the Part that it is in.

Place the fire inside of a Part, and control that part's position.

script.Parent.ClickDetector.MouseClick:Connect(function()
    local fire = Instance.new("Fire")
    local part = Instance.new("Part", workspace)
    fire.Parent = part
    part.Position = Vector3.new(35.901, 1.9, -35.233)
    local fire2 = Instance.new("Fire")
    local part2 = Instance.new("Part", workspace)
    fire2.Parent = part2
    part2.Position = Vector3.new(35.901, 1.9, -32.433)
    wait(1)
    part:Destroy()
    part2:Destroy()
end)
0
Thanks! mine_theblocks 23 — 3y
Ad

Answer this question