#1 Why is my ADS camera messed up when creating an Aiming Down Sights (ADS)?
Hello! I was making a first person shooter game and I was working on an Aiming or ADS system. I went with the two cameras option but when the cameras switch, the ADS camera is in the ground? I went back in the blueprint and the camera is clearly on the gun attached to a socket.
Why is this happening and how can I fix this? Is it even possible to make an ADS system this way or is there a better way? Thanks!
asked Jan 06 '19 at 06:00 PM in Blueprint Scripting
It doesn't matter where the ADS camera is in the viewport, that's not where it will be. You told it to sit inside the skeletal mesh's "camera" socket and that will take priority.
Check your skeletal mesh and see if you have the "camera" socket placed in the right location there.
Edit: If it is in the correct location, then you might need to zero out those transform location numbers in your viewpoint since they take the location of the socket and THEN add the requested transform. Right now according to that Z transform you're instructing the camera to hover 361 unreal units below the socket location, which may well explain why it's sitting inside the ground at the moment.
Oh, you're using the wrong command.
Activate is telling it "switch this camera on", which is fine but the AK isn't your character. When the game tries to find an active camera on your character it will never use one that's part of a different object.
Use the switch view target with blend command instead. You'll need a reference to the camera and a reference to the controller.
Edit: Just do the same process backwards (with a reference to the camera component on your character) to revert to the normal camera, you won't need to use activate and deactivate at all if you use switch view target.
Follow this question
Once you sign in you will be able to subscribe for any updates here