Can you provide the callstack and log files from the crash for additional information? Also, in attempting to reproduce the issue on my end I copied the code provided into an Actor class. Can you explain what the collisionComponent is (UBoxComponent*, UCapsuleCompnent*, etc.) and how it’s created/setup? Please include any other information or steps to recreate the crash in a fresh project.
After reading teak421’s comment I noticed that your function declaration says that the function returns a bool, but your function definition has a return value of void. I would expect this to cause compile errors that would need to be fixed before it could be used in the editor. Let me know if this is simply a typo when creating the AnswerHub post of if this is copied from your code? Also, where in your blueprint are you calling this function (ConstructionScript, BeginPlay, Tick, etc.)?
Thank you for clarifying the code difference. Can you also provide the callstack and log file from the crash for additional information? How are you using the code above? What is the “collisionComponent” variable and where is this code being called from? Are you adding this inside your actor or gamemode code or elsewhere? Please provide as much information as possible to help me reproduce the crash on my end.