Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Revolver reload animation conflict

Discussion in 'General Discussion' started by awplays49, Jan 29, 2016.

  1. awplays49

    awplays49

    Joined:
    Nov 9, 2014
    Posts:
    36
    Hello,

    I was making an animation where the player opens the revolver and dumps the bullets out, when I realized there would be a problem. When I aim the arms up or down, since the bullets are part of the gun mesh and the gun mesh is a child of the arms, wont the bullets change fall direction? Whats a solution?
     
  2. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Hide the shells, instantiate new ones (which are not part of the model) and let physics take over. Then show the built-in shells when you are ready.
     
    AaronC, dogzerx2 and theANMATOR2b like this.
  3. awplays49

    awplays49

    Joined:
    Nov 9, 2014
    Posts:
    36
    Oh wow! I never would have thought of it that way! Thanks :)
     
  4. awplays49

    awplays49

    Joined:
    Nov 9, 2014
    Posts:
    36
    Hey @drewradley. I dont think this approach is going to work.

    First of all, I want the bullets to fall the same time every time i reload. Second, I dont want the bullets colliding with me, say if i were to walk forward. Third, how could I then make a second pair of bullets go back into the gun? I think these issues are ones that cannot be easily avoided.

    But then again, It's not going to look right if I manufacture the gravity of the bullets with animation. So, what can I do? Im using blender as my graphics design software.
     
  5. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Instantiate isn't random: it will instantiate it precisely when you want it to every single time. Unity has a collision matrix which will allow you to make it so the shells don't collide with the player. Put the bullets back in the same way you planned before; just turn them back on before they are in the camera view.
     
  6. awplays49

    awplays49

    Joined:
    Nov 9, 2014
    Posts:
    36
    I know the instantiation isn't random. I'm not new. I'm talking about the gravity. The bullets will fall and collide differently every time. How can I solve that?
     
  7. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Sorry. Didn't understand what you meant. Thought you just meant the timing. Can't help you there. I like a little chaos in my shell ejections - looks more realistic to me.
     
  8. awplays49

    awplays49

    Joined:
    Nov 9, 2014
    Posts:
    36
    Then I might just do your way then. Thanks!
     
  9. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    They wont fall the same because..Your reason about arms being up/down ;-) But you could apply a world-space initial force to make things a bit more uniform. But shells falling randomly is how I've always done it. Oh once I made a sprite sheet of a rotating shell and put an animated plane in the shell ejection area and so all those shells were actually just an animated texture. I think I used a particle effect once too with animated sprite sheet of a rotating shell.
     
  10. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,960
    If all fails, you can do an animation that makes the shell drop less obvious. I think that's how most big fps games do it. Check out Call of Juarez gameplay vids.