Have a bit of an issue coming from Unity I don’t really understand:
1. Why does the capsule component not touch the ground?
This issue seems to be around the whole capsule, as the colliders don’t touch when crouching off the edge of a platform without falling:
How do you know where the true position of the collider is, if this offset always exists?
2. Why can’t I reposition the capsule component instead of moving the sprite position? It means when I reduce the capsule size for crouching the capsule goes too high, as it resizes from the centre:
3. What is this big yellow box around everything?
The yellow box appears to be a Lightmass Importance Volume; its purpose is to tell the lightmap baker that the area inside of it needs higher (foreground) quality baked lighting.
Could be wrong.
Thanks, anybody know what the collider floating issue is?
Can you show us the actor in the blueprint editor window?
I noticed it was the bottom of the wireframe for the sprite that is acting as a collider
But, I have No collision enabled on the sprite?
But Even when the sprite wireframe is brought above the collider, there is still a gap 0_o
Also the default 2DCharacterController unaltered, doesn’t have touching colliders:
However, a Capsule only with Physics enabled does touch:
I’m guessing it’s something to do with Character Blueprint not using physics and that it is something to do with this part of CharacterMovement Component:
But I can’t get it to work. Need help!
Actually, from what I can tell, the section you are referring to is for pathfinding for AI; rather un-related.
Definitely look through the CharacterMovementComponent’s settings, though. Maybe post an image (or however many are necessary) of your CharMoveComp settings.
I would like this question answered
There is nothing in the character movement component that I can find that relates to this.
In the 2D platformer video, on the Unreal channel, by Alan Noon he just seems to pull the sprite down so the feet are touching the ground while the capsule is still floating. That is one way to do it of course. So is there a cleaner way??
Not sure why nobody has answered, as this issue still persists in the latest version of unreal engine. I have noticed that in the CharacterMovement component under the Walking category, there is an entry for a variable called “Current Floor”, and when you expand that there is an entry for a variable named “Floor Dist”, which shows a value of 2.149978 for me, which just so happens to be the distance that the capsule is floating above the floor. Hovering over this variable reveals that it is computed from “the swept capsule trace”, so there is obviously something going on inside the CharacterMovement component which is causing this. Obviously the workaround is to just move the sprite down by -2.15 on the Z axis, but I agree it would be nice if there was a cleaner solution to this.
Since i ran into the same problem while experimenting with Paper2D today, here is the solution that worked for me:
I initially used scales that made sense in terms of sprite pixels. However, the physics engine works based off of “centimeters”.
Increasing the “Pixels per Unit” on sprites, or just scaling them up to a plausible size solved the issue!
I think this issue still exists today, now UE4 4.24. The capsule component needs to be placed about 4 units higher than the bottom of the character’s feet in order for the feet to touch the ground colliders.