Third Person Camera Lockon, Camera won't Aim

Hey all,

I’ve been working diligently on making a third person game with a good solid base mechanic of Combat and Exploration. However I’ve run into a fundamental issue on one of the Combat’s Systems. The Lock On Mechanic.

I can make the player constantly look at the enemy, but not the Camera. The Camera just sort of flails around, and everything I’ve tried so far makes the camera become a merry-go-round of motionsickness and pain.

http://puu.sh/coVs3/85ea05578f.jpg

That’s the one that works (mostly)

http://puu.sh/coVt3/c81c5958e7.png

Here is the camera script, that doesn’t. This just gives me a random angle everytime I hit the Lock on Button. It doesn’t even look at the object. Any help towards this would be greatly appreciated.

Thank you so much in advance all, and have a lovely day

Hi lumoblaze,

Try using a “find look at rotation” node, additionally ensure that your camera and camera boom are not using control rotation when you use this lockon. It may be getting multiple pieces of information at once which would cause the confusion.

How would I go about making sure that the camera and boom are not using the control rotation?

http://puu.sh/cqcDc/200940d626.png

This was my attempt with the Find look at rotation, and it produced the same results as the original draft

If you open the components tab and click on the camera, go into the details pane and look for “use control rotation”. If it is checked, uncheck the checkbox and see if that helps.

Hey , sorry I’ve been so horrid about responding.

I went in to see if it was checked, and it wasn’t. So I checked it off, to see what would happen.

It crashed Unreal. A moment of pride that I broke the engine for a second but sadly it didn’t help me understand what was up.

After twiddling around for a bit and using Get Control Rot and checking the “Use Control Rotation” box, I still ended up with the same spinning results.

Can you take a screenshot of your camera boom setup?

http://puu.sh/cD4al/e95c365389.jpg

The component

http://puu.sh/cD4d0/c5b0dd18e5.jpg

The “Look at this pawn” portion

http://puu.sh/cD4jJ/338a6ae1dc.jpg

The Default Camera Boom and Movement Controls

Oh I meant the defaults pane. If you go into your components tab you should have a default pane that lists the base information for the camera boom. If you can screenshot the information located there for me I might see what is occurring (these images may help as well).

http://puu.sh/cDjsR/7d9e1582ad.png

There was no default’s tab, but these looked important on the Boom.

http://puu.sh/cDjyC/dd4f59f0db.png

here is everything else to be safe

Yes. It was unchecked initially, but when I checked it, it crashed.

That is the pane I was looking for thank you. Under Camera Settings you have “Use Pawn Control Rotation” checked, this is what caused the editor to crash correct?

Ok, try unchecking it again and see if it crashes again, if it does, please post your crash logs here. You can find them at the filepath \Unreal Projects\PROJECTNAME\saved\logs\. If not, then please uncheck inherit pitch, roll, and yaw as well. These inherit the rotation of the parent classes and could be throwing off your camera as well.

I modified the code to prevent the crash. However unchecking them does allow for my code to work, but it entirely obliterates the rest of the control scheme.

Is there any way for me to temporarily suspend the inheritance, and re-enable it when the player hits the aim button again? How can I change those bools on the fly?

if you get a Get node for your camera boom you should be able to get access to the boolean values for the inheritance.

Based off of that, I made an attempt.

Here’s what happened. Instead of locking behind the player, it will always go to their shoulder. However even on a Tick Event, it doesn’t update the position of the camera as the player moves. Aiming also for some reason, inverts my control scheme. I set up counter measures for this in the Movement Input, but the counter measure only works on it’s first call, after that it’s back to Aiming consistently inverting my inputs

http://puu.sh/cEtlw/ffb7e33f9d.jpg

Current Code

http://puu.sh/cEtmw/2c5d653ab2.jpg

Counter Measures for inversion

This may be a question best asked on the forums. If you post in the blueprint section at forums.unrealengine.com, one of our users may have an answer to your question.