QUESTION: It's possible to mapping a plane in the ground?

I’m new in BGE/UPBGE and recently try to reproduce a shadow like the old retro PSX or N64 games using a plane with a shadow texture.
I know its more easy with a real-time shadow, but i really like the old games aesthetic :grinning_face_with_smiling_eyes:
It’s possible to do this in blender game engine using logic bricks or a script?
This is my blend file:
I have no idea how i do this! :disappointed:

This is what i got, the plane stays ok when i stop the player:

But when i jump the shadow follows my character in the air:

A other exemple is Mario 64, the game uses a 2d texture as a shadow:

The player jump and the shadow stays fixed in the ground

Align the fake shadow object to a ray’s hitPosition. The ray’s direction should be downwards of the player.

import bge

def main(self):
  scene = bge.logic.getCurrentScene()
  ray = self.sensors["Ray"]

  if ray.positive:
    scene.objects["Shadow"].worldPosition = ray.hitPosition

That’s cool.
Do you mean a ray sensor connected with a script?

Sorry, i am very noob. :sweat: :sweat_smile:

put the script on the player, replace "shadow" with the name of the shadow object, and connect a ray sensor to it (the ray sensor should be using the -Z axis)

1 Like

Normalization_Shadow_Bullet_Hole.blend (545.6 KB) maybe this example will work? I’m using a ray casting script here and normalizing the shadow on the landscape so that the shadow always falls on inclined surfaces, to start, use UPBGE 0.2.5

1 Like

Yes. You may also need to enable true-pulse on your ray sensor. If you don’t already know, “true-pulse” is the icon with the 3-dots to the left on the ray sensor. [the first 3-dots]

Thank you very much, I find the 3-dots, work perfectly now!

Glad I could help. :slightly_smiling_face:

Please let Grampa Doc talk about the good old Times of the Beginning of the GE. :older_man: This is one of the oldest Feature i know.

The Face Orientation can now be found in the Material, under Game Settings. Set it to Shadow, and parent the Face to the Player. This will set the Face to the nearest Ground. It works on the Centerpoint of the Face, so move it in Edit-Mode a litte upwards to avoid overlapping. You do not need Scripts or Shaders or something. :grin:

Here is a little Example for you: UpBGE 2.5b.
Old Shadow Texture.blend (584.9 KB)

Edit …
Oh, and because you have a real Object for the Shadow, don’t forget to set its Physics to No Collision. :wink:

1 Like