fix(placement): give the sidewalk collision, and the player stands on it

The staged sidewalk mesh does not block a downward trace: the capsule fell straight through to
Road_Hollywood at 366 whatever height it started at, which is why three spawn values produced
identical captures. The mesh exists, carries QueryAndPhysics collision and its bounding box tops
out at Z 380, but a trace from above it - and a capsule landing on it - both pass through.

Until the kit mesh's own collision is fixed, an invisible 279 x 8.6 x 0.08 m cube supplies the
surface: top at Z 380, hidden in game, BlockAll. Verified in the same run that used to report the
road:

  top surface under player: Z=380 actor=StaticMeshActor_52 mesh=Cube
  foot Visibility: actor Z 470, feet 382, hit Z 380

So the capsule now rests on the pavement 2 cm above its surface.

The captures still read as floating in the ground-level shots, and the table records that: the
stopgap fixes what the character stands on, not what the camera sees, and those two disagree
until the sidewalk mesh's rendered top matches its collision.
This commit is contained in:
zwitschi committed 2026-11-09 17:47:10 +01:00
1 parent 72d5bab427
commit f8b9f070d9
52 files changed
+102 -77

No files matched your search

+26 -1
View File
@@ -675,7 +675,32 @@ def build():
# Measured, not guessed: the QA self-test reports the capsule settling at Z 561 on this
# pavement (capsule half height 88), so 561 puts the soles exactly on the surface. The
# previous Z 600 started 39 cm in the air and read as floating.
player_z = 561.0
# Measured from the staged geometry: Demo_Sidewalk_North spans Y -1912..-1053 and its
# top face is at Z 380, and the player start's XY is inside that footprint. The capsule
# centre belongs at 380 + half height 88 + 1 = 469. Earlier values put the feet BELOW the
# pavement top, so the capsule started inside the sidewalk block and the downward trace
# exited through it to Road_Hollywood at 366 - which is what made the character look like
# it floated while standing on a surface 14 cm above the road.
player_z = 469.0
# Stopgap collision for the north sidewalk. The staged mesh (Demo_Sidewalk_North, top at
# Z 380) does not block a downward trace - the capsule falls straight through it to
# Road_Hollywood at 366 - so an invisible cube supplies the surface the player walks on.
# The real fix belongs in the kit mesh's collision; this keeps the demo walkable meanwhile.
sidewalk_collision = spawn(unreal.StaticMeshActor,
unreal.Vector(-14000.0, -1482.5, 376.0),
"Demo_SidewalkCollision")
if sidewalk_collision:
cube = unreal.EditorAssetLibrary.load_asset("/Engine/BasicShapes/Cube.Cube")
comp = sidewalk_collision.get_component_by_class(unreal.StaticMeshComponent)
if cube and comp:
comp.set_static_mesh(cube)
comp.set_mobility(unreal.ComponentMobility.STATIC)
# A 100 cm engine cube: 279 m long, 8.6 m wide, 8 cm thick -> top at Z 380.
sidewalk_collision.set_actor_scale3d(unreal.Vector(279.0, 8.6, 0.08))
comp.set_collision_profile_name("BlockAll")
sidewalk_collision.set_actor_hidden_in_game(True)
log("staged: Demo_SidewalkCollision (invisible, top at Z 380)")
spawn(unreal.PlayerStart, unreal.Vector(-13336.0, -1150.0, player_z), "Demo_PlayerStart",
unreal.Rotator(pitch=0.0, yaw=90.0, roll=0.0))
log("staged: Demo_PlayerStart on the cut north sidewalk, facing south (+Y)")