wow after the 3rd time watching this I finally realized I had is_action_just_pressed instead of is_action_pressed. Thank you for the fantastic turorial, I just wish I could follow instructions better!
I've been trying to make a multi viewports set up, but somehow I've not been able to pull it off. I went on your channel looking for something else, but when I saw this video, I suddenly forgot what I wanted in the first place !
There is actually a flag for materials called "No Depth Test". If you check it for the gun material, it will draw the gun above everything in the scene which fixes clipping problem in just one click. However, I'm not sure how reliable it is though, as when I used it with a 3D plane mesh displaying UI elements in the 3D world through a viewport texture,, it did still have the clipping problem with that. I learned this accidentally from one of the Godot tutorials in RU-vid and liked to share it with you.
@GrGoGamer thanks for this comment 🙏🏻, I checked and it works just fine, enable no depth test and set the render priority higher (default is 0, I used 1 for the weapon, higher values are in front). The weapon doesn't clip and receive lights and shadows.
@@HasanRx7 I did some more detailed tests with more complex meshes and unfortunately it started to give problems, in the end I solved with the viewport and the second camera following another tutorial, lights and shadows seem to work too. However, it is useful to know that there is that possibility for other features.
Thank you so much for recommending asset forge. I know it’s paid, but the fact that Kenney releases SOOO many assets for free, it doesn’t hurt to support such an incredible tool for a measly 20 bucks if you’re able :) Thanks so much for the tutorials!
This is amazing, but this is also needed to have different FOV on weapons for correct animations. But it also is bringing the next problem - enemies can have the same guns, so it's needed to switch those rendering layers. Also, muzzle flash is needed to be on a separate layer if the gun is with the player.
Maybe next you could do particles coming out the gun and music and sfx and a title screen and make a health bar and the enemy shotting Plus love the vids
I love the tutorial but there is one problem. I didn’t use asset lab and created my own shotgun out of mesh instants but the collisions refused to work no matter what so my gun is clipping through geometry. Please help?
I don't know if I am too late to help, but I also made my own model. I created a new 3d scene in the folder where I have my guns, and called it "Shotgun". Under the spatial node, I added four mesh instances for the different parts, so it looks something like this: Spatial Barrel Magazine Forestock Receiver (the part that connects the handle to the barrel) Make sure that only the weapons layer is active under "visual instance" in all peices. Hope this helps
This was a really lit video! I loved it... a better way to use scope (one can be animation player/tree). But I'm looking forward implementing it... Also it would be great if you can implement same thing on a Mixamo 3d rigged character(rather than on a capsule)!!! But I've followed your tutorial and I love them
Thank you Ish. Yes there are several ways to implement scoping, however AnimationPlayer isn't great for dynamic animations, so with this approach you can define a different scoped position for each individual weapon.
Nice tutorial. The only issue with the weapon in another viewpoint is that it can't receive the lighting and reflect the environment, this can be very annoying in the interior with contrasted lighting with omni lights. I haven't found a technique for that.
@@Zorochase Hi, I'm having similar issues. I've tried enabling the visual instance layers for the gun but it doesn't seem to do anything. The lighting still looks strange and doesn't have any of my worldenvironment adjustments (like glow). Any idea what I'm missing?
Hey Tom, have you found a fix to the lighting issue with viewports? My gun ends up with strange looking lighting compared to the rest of the world and it doesn't share the adjustments that I've made in the WorldEnvironment node (like glow and ambient light). I've tried enabling the gun's visual instance layer in my light nodes, but it doesn't seem to do anything. Let me know if you have any insight.
I was wondering the same thing, in the video you can clearly see that once the render layer changes, the weapon no longer receives lights or reflections. Besides those it would be interesting to test the shadows
I've had the most bizzare issue whilst setting up the whole viewport thing, after I added the script to the viewport container's camera when I run the game I can only see the weapon and the sky with nothing else visible, all the things in the world are on Layer 1, the Player Camera is set to only 2 disabled, Viewport Camera to everything but 2, and the weapon is also 2.
You certainly can and that's a totally valid approach. I am leaning more towards exported NodePaths nowadays though as I think it makes your scripts more robust. Scripts can easily break if you change your scene heirarchy when using the $ syntax.
@@CodeWithTom sorry very silly question but Im very bad at organizing my projects and always end up moving things around later. if a parent script with the node path method is moved will the child scripts still function normally? (I'm scared of testig it as I have broken every project I've ever started by moving things and this tutorial project is currently my only working one)
i really love godot i still going to use unreal becuse i have to finish a game first. but this engine is really easy and thank you for good quality tutorial!
Amazing tutorial but I have a few questions, how would I add animations to the guns like reload, fire, equip, and unequip? How would I add a weapon inventory system? And how would I add limited ammo?
Hi Tom, I was wondering if you have tried your FPS as a multiplayer. I am having trouble assigning my second client to my player 2 kinematic body. apparently when a both clients connect they take the default of Ply1 viewpoint, but Client 2 sees Ply2 in front and can control them while client 1 can control itself normally. Any ideas on how to assign ply2 to client 2?
did you ever manage to figure this out? it might have to do with the setting up of the camera path, I saw in the comments thread of one of the earlier videos in this series that someone mention a problem where all the enemies would turn red when only one spotted the player, even if only that one was persuing. in that instance, the fix was to make sure each instance of the enemy object was handled as a unique entity, that's how they fixed their problem. I hope this helps with your issue. you can find the convo in the chat of video 3 or 4 (of this series) I think, the episode where he adds the enemy with the pursuit feature? you'll find it in the chat there (sorry can't remember the episodes name :-) side note, can other players see the gun on the guns layer in the second player's hand and if so, can player 2 see player 1's gun clipping through terrain even when player 1 sees no clipping?
Help, I have some problem with godot, despite my scirpts being right there are not working, when i try to run it nothing happens it is acting like there is no scrpits.
If anyone knows how to make the raycast follow the weapon please provide the code and or link to a resource for this. I would like the raycast to follow the weapon (instead of the main camera) so that when you shoot, the bullet hits a different spot when aimed in/out. The raycast from the main camera works but does not have the game feel I am going for. (If you aim in/out the raycast hits the same position) When you simply attach the raycast as a child of the weapon it kinda works BUT when it gets into the “weapon clipping” range it does not have the same position as the weapon rendered from the weapon camera. If anyone knows how to have the raycast follow the weapon when ads in/out WHILE STILL rendering the weapon on a different camera please help me out!! Much appreciated!
So I have a pickup system so I am switching layer visual instance of mesh one thing I noticed was when viewport shows the gun the gun colouring changes it becomes brighter how can I solve it this bug stands out bad
When I tried running the code after adding "raycast = get_node(raycast_path)" The debug view immediately crashes, opens Shotgun.gd, and the debugger outputs "Invalid set index 'cast_to' (on base: 'null instance') with value of type 'Vector3'." Any idea why?
Hi total noob here, but.... I think you forgot to remove shotgun.gd from the old weapon node? as shout gun script should not be active at this point in the vido. [edit] I also copied the shotgun script contents into my weapon script but just because I wanted to set range more easly during testing, still it might help.
Hi, total noob here, but I saw how they did it in the doom clone demo project avaleble from Godot assetlib, its basically an animation that plays after (or as part of) the fire animation, Earlier in this chat tom has a chat with someone about the power and drawbacks of the animation tree. here's a really cool video about ways to use animation tree ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OUvpe9FMkLI.html
plzz bro plzz plzz male a tutorial on eqiuping different wepons as you said in video plzz plzz this topic is rushing now, no one had made a video a lot of people need this including me plzz make thia video.... also, can pickup gun from ground ....