How do i make a cylinderlooks to where it is going to? (BEZIER CURVE)

It seems to be aiming towards where the mouse is rather than the cylinder’s direction. Are you sure the code is set up correctly?