I’m creating an FPS game and I have the gun, and I have the camera. So how do I go about making the camera hold the gun? I’m rather new to Unity so most of the answers out there just baffle me. Maybe if you could provide a step-by-step explanation here it would be really helpful
You need to add a capsule collider to your camera that way you have collision with your player and then parent your gun to the camera.
Step by step: ( The gameObject and Component tabs are at the top of the screen )
- Go to gameObject tab → click create other → camera
- Click the camera → go to component tab → physics → capsule collider
- In the hierarchy tab drag the gun into the camera[This parents the gun to the camera]
Now when your camera moves your gun will follow and you will be able to collide with things like the floor. You can also import and character controller asset that has the code all set up to move around. Go to assets at the top import → package → character controller.
Hope that helped.