I am trying to zoom in/out of my character via setting the TargetArmLength of the attached SpringArmComponent. Through play in editor I could confirm that the TargetArmLength is correctly set, though it does not change the view of the attached CameraComponent. If I set the TargetArmLength manually in play in editor though, it works.
Also my code used to work, but after working on some other classes, it suddenly does not anymore and I really can not work out why, because I have not made any changes to anything that would be connected to this.
I am using the 4.24 source build.
The logic seems fine. If it worked before and doesn’t now, then it seems like something interfering with this code.
Make sure the function is actually getting called.
If it is getting called and the data is set correctly. Make sure the camera component is attached to the spring arm. Perhaps something in the code is reparenting the camera somehow?
Also my code used to work, but after
working on some other classes, it
suddenly does not anymore and I really
can not work out why, because I have
not made any changes to anything that
would be connected to this
I have had many scenarios like this
The next step would be to work backwards to see when this issue began. Issues like this demonstrate why source control is extremely important as it makes it easier to look back and revert code changes without damaging a project further.
If you are still struggling. I would implement your camera spring logic in a clean project to make sure it is absolutely 100% working then overwrite your current implementation with the clean one.
Unfortunately, there isn’t much more I can suggest.
I ended up removing the code and adding it again bit by bit, compiling after every bit to see if it still worked as intended. For some reason that worked ^^