I try to use Spring Arm, but the camera is first-person with it, and collision test also do not work. It seems that the camera is attached to the component that the Spring Arm is actually attached to. Spring Arm just does nothing (or something I don’t see). Maybe I need to enable some plugin, or enable the Spring Arm in some way? Who knows?
Hey @Etyuhibosecyu,
How is your spring arm set up on your blueprint? Can you share screenshots? Is it how the example third person character is set up?
Any additional info you provide may go a long way in solving your problem!
@Quetzalcodename, yes. Here is the part of the Components panel:
And here is the Details panel of the SpringArm:
Those spheres have zero radius and are used just for combining locations and rotations.
Hey @Etyuhibosecyu,
When you open your blueprint where is your camera in the scene? Is it centered on the spring arm? Also, is your camera arm not centered on your capsule mesh? If the camera is supposed to be, have you tried attaching it directly to the capsule to see if that makes a difference?
@Quetzalcodename, here is the position of the camera (this is an abstract player class so there is no mesh but in the subclasses it is inside the capsule):
Here is the view that opens from the camera:
Bump. The topic is actual.
Hey @Etyuhibosecyu,
I noticed in your blueprint screenshot that your capsule is half way into the ground. Does picking the asset up do anything? Also, to rule out the issues being your spheres, if you move the spring arm directly on to the capsule, does anything change? Do you have collisions active on those spheres? if so, what happens if you disable them?
The player is already above the ground so that he collides at the bottom of the capsule.
I tried, nothing changed.
The spheres have zero radius, so they cannot have collision.
@Quetzalcodename, are you still here?
Maybe the camera just doesn’t activate and it just seems like it goes to SpringArm? Do you have AutoActivate checked on Camera too? Or possibly some code deactivates it after.
No, AutoActivate is set to true on both camera and SpringArm.
At least, the OnComponentDeactivated event doesn’t trigger.
But, I have noticed that enabling the camera lag does something! So, the SpringArm is not “dead”. But TargetArmLength and DoCollisionTest somewhy do not work.
Hey @Etyuhibosecyu,
This looks like it inherits from the character class, is that correct? If so, does this happen with new characters that are created? Also, what is the FOV and camera clipping set at for your camera?
Wait, I just realized, at your SpringArm the Probe Size for Camera Collision is huuge! It is 160 while basic value for character is 12, possibly it’s just so big that it constantly hits the ground
That size is in centimeters, isn’t it? The near clipping plane in my project is 160 cm, so I put an equal value into ProbeSize. What am I doing wrong?
@Quetzalcodename, I have now tested SpringArm in an empty project, then in another level of my project with different character, then in another level of my project with my player character, and all of these cases work! The arm length definitely works, and the collision is harder to test so I haven’t done that yet. I think one should fix arm length at first. So, the SpringArm is disabled somewhere in my level. But where? Which are possible places?
It is in Unreal units, meaning probably cm if you have it set so. I don’t think near clipping plane should be same as Probe Size. Probe Size is a radius of a sphere around the camera that tries to get closer to SpringArm when it detects any collision, you could say it’s camera collision and whenever it gets hit it moves forward. So, looking at basic character, it has height collision of 180cm. (white line on the pic)
So you can imagine if there’s a 160 radius sphere checking for collision that is put lower than character height, it keeps hitting something (in this case the floor) and going all the time into the SpringArm
Quick visualisation of how big that is compared to base character, here I put a sphere collision around camera that has around 160 cm radius:
@Almost_Absent, I have just tried to set the ProbeSize back to 12 but nothing has changed.
Well then it must be something else. You can try checking on ur level in your pawn if the SpringArm’s length changes, maybe there is something overriding it.
If it works on other levels and not this one, then another wild guess is there might be a difference in GameModes or there is some code in LevelBlueprint.
GameModes might be a thing, I saw some posts where people said they created their own GameState and that screwed up with their SpringArms (weird), they fixed it by creating GameStateBase instead.
No, it returns correct arm length.
For now, I have even checked in the main level but with the different GameMode, and it works! So, the difference is either in the GameMode or in the PlayerController. Also, the LevelBlueprint is empty.
“Pure” replacing GameState with GameStateBase did not fix the problem, and I saw some posts that combining GameMode with GameStateBase and vice-versa leads to other hardly catchable bugs.
Yeah if you wanna use GmaeStateBase then you need to create GameModeBase too to avoid issues.
Sorry, I don’t know what there exactly is more likely to be causing issues with SpringArm, if no one gets here with something specific, you have to go with try and error changing gamemodes or controllers/states untill you find which one was causing it.