Quantcast
Channel: Questions in topic: "error"
Viewing full articles (7934 articles)
Browse article index
↧

How can i fix that error ? (see in the description)

$
0
0
Hello, I have a game, a FPS, that i've created with videos on youtube and also on my own. I have two weapons : a Primary weapon and a Secondary weapon. I made animations when i reload and when i shoot with both of them. I start the game, i take the Secondary weapon (which is a gun), and then i shoot a few times. The shooting animation works normally. I reload one time, and the reloading animation works too. But, after reloading, if i shoot, the animation doesn't work. And after that, if i reload, the animation doesn't work too and i can't shoot anymore. With tests, i discovered that one variable of the script ShotEject (see in the screenshots), who needs a gameObject in Unity, get to none. Normally, i fill that variable ( named weaponTransform) with the Secondary weapon in Unity, in the inspector, but when i have the error of the animation just after reloading for the first time, the case which is filled with "Secondary" get to "none". If i quit the game, she gets to "Secondary" again. With that description, i give you screenshots of the script "ShotEject", of the error in the console and of the inspector when the gameObject disappear and the case get to none. Also, i have an other public variable called "isReloading". That variable is true when i am reloading. Else, it's false. But, after the "weaponTransform" getting to none, if i reload, the variable become true and stay true until i quit the game. I can onIy put two screenshots so if someone look at my question and want to try to solve my problem, just say it and i'll send him the others screenshots needed. I hope that someone can help me to fix these errors. Feel free to ask me details. Thanks, A user of Unity.alt text [1]: /storage/temp/112496-capture-decran-2018-03-06-a-191501.png
↧

Viewing full articles (7934 articles)
Browse article index

Latest Images

Trending Articles



Latest Images