Problem with camera
I'm trying to make an fps shooter from scratch, but I'm having some problems with the gun graphics. To keep it on the camera at all times, I attached it to the camera, but it seems that the gun mesh...
View Articlegun shooting script, gun activation script if you help me solve it when i...
[alt text][1]I had a problem with this script of my game to shoot the pistols and I got this error error CS1525: Invalid expression term can you help me and I tried to solve it but I could not this is...
View ArticleHow do I create bullet hole for my gun?
I want to create a gun I followed a tutorial but my Bullet holes are not in the correct position GameObject bulletHole = Instantiate(bulletHole, hit.point + (hit.normal * .1f),...
View Articleanimating multiple weapons with 2 arms
I am making an fps shooter but I have ran into a problem with the animation. The problem is the animations with multiple different weapons and 1 set of arms. I have looked on YouTube and they all only...
View ArticleHow do I make it so that my bullet projectile for my gun does damage?
Hi, I am new to both Unity and C#. I used a 2 part tutorial to make a gun script, if needed the channel name is "Dave // Game Development." The tutorial's first episode has a projectile bullet-type...
View ArticleWaitForSecond Corountine Sleep Time Varies
Code: public float shooting_wait_time = 0.2f; public int bullets; private bool waiting = false; void Update() { if (Input.GetButtonDown("Fire1") && bullets != 0) { if (!waiting) { // Do...
View ArticleClamping turret rotation on Y axis not working
Hello everyone ! Here is my issue, I have a gun, I am trying (I technically succeeded) to clamp its rotation on the Y axis between -35 and 35 degrees, and I mean it works, but for some reason this -35...
View ArticleCan clamp X axis but NOT Y axis on my rotation
Hello, I have been trying for days, I read every single post I could find on Reddit, StackOverflow, Unity forums, nothing helped. I am seriously desperate now. Answer there is pretty much always the...
View ArticleIm trying to make a Karlson style gun sway(Karlson not released)
Hey Everyone! im trying my best to make a karlson Gun sway, but i cant get it right (with karlson i mean the not released karlson), anyway please help me for some code it will be amasing if someone...
View ArticleI Want To Shoot Bullets Correctly.
Hello Everyone! so not very long ago i asked a question and based on what's seen or what seems obvious it was not asked correctly so let me explain again, so basically i want to shoot bullets with a...
View ArticleI've been trying to make a gun script, but somehow the boolean to tell when...
So im trying to make a gun script, and this is the script that is attatched to the bullet. My issue, is that when the bullet hits an enemy, it does not set "hashit" to true. It does detect the...
View ArticleWhy is my gun stretching out when I pick it up?
When my gun is picked up, the transform changes from 0.02 on all axes to 1 on all axes. If it helps, here is my pick up system script: using System.Collections; using System.Collections.Generic; using...
View Article2D gun aiming problem
Hi, I'm working on a 2d game where the player holds a weapon and aim /flip with the cursor. When the player is flipped, the rotation / aiming with the mouse isn't fluid anymore, the player is not able...
View ArticleChanging character X axis rotation so that gun points at target issue
Good evening everyone! I am making a WWII shooter and currently working on the AI I am simply trying to have the back of my character move up or down in order for my gun object to point at the target...
View ArticleHow to disable the previous child object of a parent,How to disable previous...
Essentially im using a gameobject to store guns that the player has access to and there is a script that allows the player to pickup a weapon. however when the player picks up the weapon it doesnt...
View ArticleHow to bring reticles in different situations to the center of the camera?
I'm making a part to look into the optical sight and scope when aiming in an FPS game now. The gun is a child object of the right hand when it is not aimed, but when it is aimed, it has a parent-child...
View ArticleHow to lerp rotate the gun to the opposite of ur mouses X position and clamp it
i wanna lerp the position of the gun to the position of the gun + the mouse x position but i dont want the gun to rotate more than -30 and 30 on the y axis... pls help i have no idea how to even start...
View ArticleHow can the ammo go to 31 at the start of a game?,How can I make The current...
How can I make it that the ammo goes toe 31 at the start of the game? using UnityEngine; public class Gun : MonoBehaviour { [Header("References")] [SerializeField] private GunData gunData;...
View ArticleGranade script
Hi people. I need a good granade script for my game. the actual script what i'm using is this: public class BulletSc : MonoBehaviour{ [SerializeField] public Rigidbody rb; [SerializeField] public...
View ArticleBullet not affecting health
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Gun : MonoBehaviour { public Transform firepoint; public GameObject bulletPrefab; void Start() { } // Update...
View Article