Can someone explain to me how to solve this error

? means optional, false or a value of the type. So you need to warp the value with option{VALUE}

var LocationToGo:?vector3 = option{vector3{X := GetRandomFloat(-DistanceFromSpawnPtToMove,DistanceFromSpawnPtToMove),
Y := GetRandomFloat(-DistanceFromSpawnPtToMove,DistanceFromSpawnPtToMove),
Z := 0.0 }}