I’m taking about the Pumpkin Run game from the GameKit. The Pumpkin has a shadow on it that is parented to the pumpkin. At the start of the game, the pumpkin falls to the ground and the shadow immediately pops to the ground. When the pumpkin touches the ground, it goes up in the air but the shadow does not.
I don’t see any scripts in the piece.
I don’t see any sensors/controllers/actuators linked to the shadow.I’ve tried creating simple examples that use parenting and vertex parenting.
I’ve removed all the sensors from the pumpkin and it still bounces.
How does it work? How does the shadow stay on the ground?
Wow - that’s well hidden. Disabling shadow on the Pumpkin Run file does make the shadow stop the “on floor” property, but when I try it with a mesh of my own, it just stays parented to it’s owner. How does it link?
The shadow attribute is related to the faces of a mesh. Just faces with shadow active will act as a blob shadow. These faces form a separate mesh. A ray along -Z will be send freom original object center. Then the ray hits something the shadow mesh will be placed at the hitpoint of the ray aligned to the normal of the hit surface.
This is build in function. There is no need for logic bricks, parenting or any properties.
Finally you just need 2 objects. One that acts as ground and one that contains shadow faces in the mesh, placed above the ground.