+1 vote

I am trying to make an fps game, and I'm trying to add weapons, all the tutorials I have looked at tell me to make the gun in the same scene as the player but that does not work for me because I made a system to switch between weapons, and the weapons have to be in a different scene than the player, so I was wondering if anyone knows how to make a gun in a separate scene


in Engine by (15 points)

1 Answer

+1 vote

Create a new scene and make the gun, save the scene and load it when you need it.
You can preload all the guns ("gun scenes") when you start the scene with the player

var granade = preload("res://guns/granade")
var shotgun = preload("res://guns/shotgun")

and then show/hide/disable then as you need to.

To add a new scene you can click on the plus icon next to your current scene or at the top menu scene > new scene

by (396 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.