This video shows how to implement a shader to prevent weapon view model clipping into walls in Godot 4.3. The twelfth video of my character controller tutorial series.
weapon_clip_and_fov_shader.gdshader and function to apply shader to view models:
https://gist.github.com/majikayogames/94ac6c76650a609e4db09febb82ab197
Godot shader transform pipeline cheat sheet:
https://imgur.com/gallery/godot-shader-transform-pipeline-cheat-sheet-rlns0q6
Full Playlist: https://www.youtube.com/playlist?list=PLbuK0gG93AsHID1DDD1nt4YHcdOmJvWW1
GitHub Repo: https://github.com/majikayogames/SimpleFPSController
All source code and included assets are licensed under the CC0/public domain license.
Contents of this video:
0:00 - Intro
0:25 - Premade weapon clip shader (link in description)
2:41 - How to create your own weapon view clip shader
5:10 - Godot 4.3 and 4.2 differences for shader
8:24 - Modify weapon FOV
13:28 - Godot shader transform pipeline overview
If this tutorial helped you, consider supporting the channel on Patreon or Ko-fi:
https://www.patreon.com/MajikayoGames
https://ko-fi.com/majikayogames