Workspace.Cannon.ExplosionEffect:9: invalid argument #3 (Vector3 expected, got Instance)

I tried to make cannon explosion effect, but it doesnt work.

local boom = Instance.new("Explosion")
boom.BlastRadius = 10
boom.BlastPressure = 0
boom.Parent = game.Workspace 
boom.Position = script.Parent.Explode
boom.Position = script.Parent.Explode

Did you forget to put .Position ?

no it supposed to explode this part ( where explosion effect happens )
image

Yeah but you set the position to an instance not a vector3

You need to do:

boom.Position = script.Parent.Explode.Position
2 Likes

You need to add .Position at the end of script.Parent.Explode because when you leave it as is, you are directly referencing the part, not any of it’s properties.

So, you need to change script.Parent.Explode to script.Parent.Explode.Position

2 Likes

This should have been given the solution mark, not that it matters.