Search code examples
c++unreal-engine5unreal-blueprint

camera stuck at player feet unreal engine 5.1


I am working in unreal engine 5.1. I have the problem that the camera is stuck at the player feet, and when I go into the blue print player character to edit the position of the camera, no details show up in the details panel when I click on the camera. I have followed the "Setting Up Character Movement" tutorial for C++ on the unreal engine documentation, and at no point did they adress this or add anything in the code that would change the position of the camera. The link to this tutorial is https://docs.unrealengine.com/5.2/en-US/setting-up-character-movement/.

I tried googling the problem, asking chatGPT, etc., and nothing helped. I tried activating the camera with the cameraComp->Activate() function, I tried adjusting the different variables of the spring arm component and camera such as socket offset, target arm length (for the springarmcomp) and additiveOffset (for the camera), but the camera won't budge. I want to have a third person camera that trails behind the player. Here's a picture of the error occuring in play mode (I am looking up to give perspective as to where the camera is in relation to the mesh): problem Here's my code: https://pastebin.com/jjk4q61y image of not seeing anything in the details panel when i have the camera component selected: details not showing


Solution

  • I solved it. I had to use this code:

    SpringArmComp->bDoCollisionTest = false;