Search Unity

Bullet Collision Problem then it flys fast (SOLVED)

Discussion in 'Scripting' started by warkarma, May 8, 2010.

  1. warkarma

    warkarma

    Joined:
    Oct 9, 2009
    Posts:
    73
    Hi all.
    I am trying to make a bullet with collision which has trail in my game.
    Thr bullet works fine and collision is working fine then it is flying very slow, however I want my bullet fly very fast. I have made the bullets speed a lot bigger but the collision doesnt work all the time. The bullet continues on flying in the empty space.

    Because my English is bad and it's hard to explain everything I made a small pre-set scene which you can downlaod and open it up to see for yourself. If you have any ideas on how to fix this problem, please let me know.

    Link to the scene/lvl/game:
    http://tinyurl.com/victor-r/4forum/Lvl1.unitypackage

    Thanks a lot for any help.
     
  2. Creative

    Creative

    Joined:
    May 8, 2010
    Posts:
    184
    Change the speed through the inspector.
    Also you can destroy the bullet in a cerain time like that :
    in the script that is attached to the bullet :
    var timeOut = 3.0;
    function Awake() {
    Invoke("Kill",timeOut);
    }

    also, you can check if the collision stays with OnCollisionStay, also the collision must work all the time, unless it doesn't hit the collision.. you can also Debug.Logs if it touched a collision..
     
  3. warkarma

    warkarma

    Joined:
    Oct 9, 2009
    Posts:
    73
    Yeah I have done the destruction after some time, but the main problem then I make the bullet to fly faster it doesnt colide from time to time.

    For example If i shoot the wall 1 bullet colides with the wall and other doesnt, and its very rambdom.

    I will have a look at the collisionStay, but I think its not the problem.
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
  5. warkarma

    warkarma

    Joined:
    Oct 9, 2009
    Posts:
    73
    This worked perfectly. Thanks a lot !