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
It’s possible to do this in blender game engine using logic bricks or a script?
This is my blend file:
https://drive.google.com/file/d/1OPt2bBiGmAOmGD6SBJSrzdxKXeS2-OOA/view?usp=sharing
I have no idea how i do this!
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
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)
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
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.
Please let Grampa Doc talk about the good old Times of the Beginning of the GE. 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.
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.