Trigger fires, but the code doesn't execute.
private var guiTextObject : GameObject; private static var textOn : boolean = false; private static var triggerID : String = ""; private static var messageToDisplay : String= "Message Text"; private...
View ArticleFramerate Independent Firing Rate (delta time?)
I am attempting to make a consistent firing rate. I have done a lot of research on figuring out consistent rates that are independent of framerate and most of the articles about it use deltaTime....
View ArticleFiring Sound
I have a firing script, as shown below. How do I add a sound that plays whenever the gun fires? It is a machinegun, so it needs to loop when you hold down the button. var projectile : Rigidbody; public...
View ArticleMissile Firing Script Help
I have the following missile script. It should shoot a missile, but whenever I press the defined key, nothing happens. Help? public var projectile : Rigidbody; function Update () { if...
View Articlethird person shooter
I have a third person shooter on my game. He moves properly,But he fires randomly.How to set him fire only on the center of the screen?? please let me know where should I insert or modify the code.I'm...
View ArticleNothing Happens at OnTriggerEnter ?
I've got a problem about OnTriggerEnter; #pragma strict static var health : int = 100; var bullet : GameObject; var explosion : GameObject; function Start () { bullet =...
View ArticleFiring only a single projectile at a time, then adding a second.
I know there are a lot of projectile scripts and questions out there but I could not find one to answer what I am after. I have a point in the centre of the screen that projectiles get fired out of....
View ArticleHow to avoid speed change in bullets while moving?
I've seen many examples about shooting in unity using the physics approach and the transform too but something I was wondering is how to prevent bullets from changing speed while moving. The Space...
View ArticleProblem adding force to a bullet
So I have a character with a script that handles movement and weapons firing. The bullet is fired when the user clicks, instantiating at an empty object that is a child of the character gameobject. I...
View ArticleProjectile firing at wrong height
I've been trying to get an enemy to fire a projectile from a spawn point, and while it's firing in the right direction and at the right speed, the height is way off and I don't know what's causing the...
View ArticleCan't activate my timer for shooting script?
I have two scripts, I'm attempting to make my first script use a timer (my second script) and I'm not very good at referencing so I decided to try it out and understand it better. so I created the...
View Article2D bullet angle question. Please Help.
I'm trying to make a 2D sidescroller with shooting, where moving the mouse up and down moves the gun the player is holding but only until a certain height (similar to the game metal slug.) The player...
View ArticleMultifiring functions c#
I have a simple piece of code here, that should only fire once. but for some reason, it activates 'Newfirst' three times before it stops. Anyone have some insight as to why? if(keepchecking==0){...
View ArticleSwitching Firing Modes
I've searched all over to find a way to do this and spent 2 days doing so with no luck. So far, I have an x-wing style ship with 4 laser turrets. I have a script to fire all 4 at once, but I need to...
View ArticleAnimation events not firing
I'm having a problem using animation events for a looping 2D sprite animation. While the events usually fire, they don't ***always*** fire. For example, I have a sprite that fires...
View ArticleLimited fire rate?
I have a script for a weapon that. I want the fire rate to be limited until the firing animation is finished. because right now, i can fire multiple bullets while the first animation is finished. Is...
View ArticleGun Turret Script. Help with distance C# Script
Hey guys I'm going to try and be as specific as can be as I'm completely new to C# Scripting. I'm trying to make a Gun Turret shoot at the play which is all sorted. But I'm having problems, I need to...
View ArticleBullets going wrong direction
No matter what I do the bullets either go left ( When doing rigidbody.velocity(transform.forward * bulletSpeed) or right when - forward, Up with Transform.Up Down with -Transform.Up... I've rotated the...
View ArticleMy turret is a pacifist.
I have the following code - and all the turret does is look at me. first script - should control the elevation and fire the gun - not sure it is actually doing anything. var shootAngleDistance = 10.0;...
View ArticleWhy can't i firing a bullet when holding down left and up arrow keys by...
I have coded a small game where you are stationary in the middle of the screen and you can hold down left arrow to fire left, up arrow to fire up, right arrow to fire...ETC while i recently coded it...
View Article
More Pages to Explore .....