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.
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
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.
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.
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.
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).
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?
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
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.