Coding for a unique VTOL plane

Hi, I’m trying to code the transform process for the craft.
I’m new here.
Can someone tell me where should I adapt the code???
thanks.
(I’m using the Tailsitter code for hovering.)