Тёмный

How (Not) To Pick Up Weapons in the Godot Game Engine 

Chaff Games
Подписаться 7 тыс.
Просмотров 4,3 тыс.
50% 1

Don't try this method of picking up and dropping weapons in the Godot game engine.
Check My New Course : www.udemy.com/course/building...
Support Me: patreon.com/ChaffGames
Get the FPS Template Here: chaffgames.com/fps-game-templ...
So I’ve added guns, I’ve got some recoil. Now if we’re making a multiplayer FPS or even just an offline FPS we need to be able to pick up or drop weapons when we see them on the ground. That’s an almost universal ability found in FPS games. At least if there’s a limit on the guns you can carry at any one time.
Once I had outlined the process of picking up and dropping weapons I head realised that it was going to take a while to set up the pick up and drop for each weapon. So I decided to take a more "creative" Approach that led me into some interesting territory with Godot's physics.
Please like and Subscribe! It's truly appreciated
#GameDevelopment #GameDevelopment #Godot
Links to my Socials
Instagram: / chaff.dev
Twitter: / chaffdev
Itch.io: chafmere.itch.io/godot-fps-co...

Игры

Опубликовано:

 

3 дек 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@Theraot
@Theraot 2 года назад
You could have made a RigidBody parent for the gun. Dropping would mean instancing the RigidBody, removing the gun from the player character and adding it to the RigidBody, and adding the RigidBody to the scene. And picking would remove the gun from the RigidBody, add it to the player character, and free the RidigBody. That way you can use the same object both on the player and the ground. And you would not have a RigidBody child of the player character. Notes: - be careful with signal connections. You don't want the dropped gun to keep shutting, and you want the picked up gun to shoot. - don't forget the RigidBody needs a collider, and you probably want to make it fit the gun. You could store the dimension on the gun scene. Edit: get the mesh from the MeshInstance, and then get the AABB from the mesh, and use its size for the RigidBody collider. By the way, instead of doing if c.get_class() == "MeshInstance": you can do if c is MeshInstance:
@MakutaOfficial
@MakutaOfficial 10 месяцев назад
This was really inciteful as I always wanted to avoid instancing items at any given point (I really, really dislike giving players an ability to instance and queue free items as it can lead to item duplication and deletion bugs). Glad you could run through this on your own so that I didnt have to! Lol.
@CodedSlush
@CodedSlush 2 года назад
Great insightful video man!!!
@Chaff_Games
@Chaff_Games 2 года назад
Thanks dude!
@HendrikWiersma
@HendrikWiersma 2 года назад
Your Itch link doesn't work.
@Chaff_Games
@Chaff_Games 2 года назад
Good Pick Up! All Fixed. Thanks for letting me know.
@jared7650
@jared7650 2 года назад
Something something... Programmers lazy... Something something 😛 Btw couldn't you just place the gun on a different collision layer then the player? I think that might fix some of the issue
@Chaff_Games
@Chaff_Games 2 года назад
Yep, that's essentially what I'm doing. I take the gun off the collision layer when it's picked up and put it back when it's dropped.
@Ceisriel
@Ceisriel 7 месяцев назад
weapon.get_node("CollisionShape").disabled = true
@tomaszgoral8154
@tomaszgoral8154 2 года назад
Why not approach weapon pick ups the same way the old 3d gta's did it?
@Chaff_Games
@Chaff_Games 2 года назад
I'll check it out ☺️
Далее
Beautiful game!😍
00:20
Просмотров 1,5 млн
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 480 тыс.
I Made A FAKE Game To Prove Steam Will Publish Anything
13:06
Committing War-Crimes with the Spotify API
7:06
Просмотров 91 тыс.
How I added LOTS of weapons to my game!
5:18
Просмотров 50 тыс.
I Optimised My Game Engine Up To 12000 FPS
11:58
Просмотров 587 тыс.
Signals in Godot are Amazing!
5:17
Просмотров 25 тыс.