Hi there - I’m new to the Engine, and I have a problem with the world coordinates that I get for my player.
My player (Character Blueprint) consists of a cylinder with scale = 1 and location/rotation all 0. Also it has a capsule component (Collision cylinder) as the root component, also with scale = 1 and location/rotation 0. From the capsule’s perspective it seems like the cylinder has a height and width of 100 for some reason. (It’s the same when I place the player in the world - so I guess scale = 1 for an object in the Viewport means 100 units within the world?).
Anyways, I set the capsule’s radius and half height to 50 to match the cylinder size. In the viewport it looks like it matches the outside bounds and the bottom/top edge of the cylinder exactly with these settings, which also makes sense to me mathematically. So far, so good.
But: When I place the player in the world, at coordinates where the bottom of the cylinder should be exactly on the floor (meaning: Z-location of player is capsule’s half height = 50 units above the floor), and then I start the simulation and let it print the “Get actor location”, it tells me that the actor’s Z location is not 0 - which I would have expected - but instead 2.325.
I then changed the player start positon to be somewhere up above the floor, to let the player fall down onto the floor at the start of simulation. In thise case, when the player has landed, it tells me the Z location is 2.150.
Now, I guess what happens in the case when I place the player directly on the ground is that the capsule actually collides with the ground on simulation start and pushes it up a bit, and this is not happening when I let the simulation drop the player to the ground.
But, to me, neither of these behaviours are correct. According to the capsule’s properties, it should be exactly the same height as the cylinder that it holds (100 units). So why would it be floating ~2 units above the ground?
It seems to me I can never really know where my player is located on the Z axis with this inaccuracy. I am currently trying to implement a custom “ascent/descent” movement, and I wanted to detect whether it has started/ended by seeing if my player’s Z location is > 0 or not. But because of these weird 2.xx deviations my logic doesn’t work properly.
In summary, here’s my question: What is the reason behind these 2.xx values and how can I make may player (meaning it’s base, i.e. his feet or in my case just the base of the cylinder) be walking on Z = 0 trough the world?
Thank you