Hi . I attempted to duplicate the issue you were experiencing, but was unable to do so with the code snippets that you provided. Could you provide some more information about what is happening? Please look here to get a better idea of what information would be helpful. In particular, can you reproduce this issue in a brand new project made from one of the available templates? If so, please let me know exactly what steps you take when creating the project, what code you add, and how you add it. Make sure to include as much information as possible, since even seemingly minor details can potentially cause drastically different outcomes if left out.
Did you verify that your Canvas object isn’t null? You should exercise safer coding standards to prevent potential crashes. For example to protect yourself from crashing on a bad canvas object you could do the following
checkf(Canvas, “Canvas is invalid! Deproject will not be called.”);
if (Canvas)
{
const FVector2D Center((Canvas->ClipX * 0.5f), (Canvas->ClipY * 0.5f));
Canvas->Deproject(Center, Origin, WorldDir);
}