The lantern model goes through walls in first person

Godot Version

Godot 4.3

Question

I added a 3D model of a flashlight to my first person game, simulating the flashlight in my hands, but when I get close to the walls the flashlight goes through the walls, how can I fix this so that the flashlight is rendered in the foreground?

I think the generally accepted ways of handling this for first person games is either rendering the hands (and whatever they’re holding) on a separate layer so they always appear over the game world (simple), OR using inverse kinematics to actually push the offending appendages out of the way (more complicated).

Here is a short tutorial from YouTube creator garbaj on the former technique: https://www.youtube.com/watch?v=9i6uxm_ioG0

And here’s a more recent one from Gwizz based on garbaj’s: https://www.youtube.com/watch?v=Nhx3-hViv-Y

1 Like