Simple question I am in the process of modifying a script of a roblox tool from the olden times. But i need the spawnpos variable to be detected in my raycast and it says it’s “unknown global variable”. How do I make it work? I could just use a string value but I get the feeling that it may be redundant. Is there a simpler way ? (sorry if this has been asked before)
Here is the important part of the script:
function fire(v)
local missile = Instance.new("Part")
spawnPos = vCharacter.PrimaryPart.Position + Vector3.new(8, 0, 0)
local ray_for_tween = workspace:Raycast(spawnpos, Tool.Parent.Torso.LookVector * 10000)
thanks in advance