So, i have this c++ line of code. It compiles, no errors, but when i run it on a mobile device the app just crashes. Any ideea?
TouchLocationBegin is a FVector2D.
Well, it still crashes. Altough i tested it and the line that crashes the app is the one i showed in the initial post, i added a bit more context, just in case…
P.S.: The debug message does not appear, so il belive the controller is valid.
Is PlayerRefference valid?
Are you running the code directly from VS (F5) and if so are there any error messages? If that line and that function (BeginTouchSteeringSheel) is triggering the crash, what are the values of its parameters? There must be a window in VS with the values of PlayerController, PlayerReference, Pressed, TouchLocationBegin.X and Y when the crash happens.
PlayerRefference was not valid… problem solved. I Thank you for your help, i would not have tought about protecting the code. I am a beginner with c++
What happened is that i tryed casting to the player character using GetPlayerController instead of GetPlayerCharacter… i only realised this after seeing that the refference is not valid.