Download

Capsule Collider Floating Problem

Hey,
Have a bit of an issue coming from Unity I don’t really understand:

1. Why does the capsule component not touch the ground?

5c7684e46ffe12d6c9f6954ea038af535aedf052.jpeg

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:

37c65651036eee3e407e90082c9f4a42f1c61bc7.jpeg

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:

0bad1b02c1d7f1884bd0efe3b57d5a1692a2052c.jpeg

3. What is this big yellow box around everything?

702a0cb15bf4533372472b1b3600b99a24bd0648.jpeg

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?

ss (2016-01-01 at 04.10.52).jpg
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?

ss (2016-01-01 at 04.12.21).png

But Even when the sprite wireframe is brought above the collider, there is still a gap 0_o

a69efca4bdb8e1ae778dfd382561307dc96dcb6c.jpeg

Also the default 2DCharacterController unaltered, doesn’t have touching colliders:

f3627b50b0aee20a37cb8ff79b9ef6a85cf0bd4d.jpeg

However, a Capsule only with Physics enabled does touch:

4e5c7b9b0911307484cbe5432352564e06bd54f9.jpeg

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:

82bc808f0e7d0718ef0b0e415c327734da887541.png

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 :smiley:

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. :slight_smile: 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.