R plotly get legend show color but not split

My plotly lines are split by the interaction of two groups, and colored by another group. It is working except the legend still show all the interactions, which is unnecessary. I am currently using the code below:

plot_ly(x = ~x.center, y = ~y.center, z = ~z.center, type = 'scatter3d', mode = 'lines+markers', opacity = 1, marker = list(size = 2), 
        split = ~interaction(spreadsheet_row,participant.id), color = ~tasktype)

Just want the legend to be below (color by tasktype): enter image description here

Thanks in advance for help.