Search Unity

making sword system

Discussion in 'General Discussion' started by Yash987654321, Feb 28, 2015.

  1. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    am new to unity and I just started to make a
    first person game (Much like dishonored). i
    created a animation but it didn't work well. so
    can anyone suggest me how to do this because
    with animation either the sword go through the
    walls or if it aninare physics then i fly high in thr
    sky. can it be done With the springs or can you
    suggest and JavaScript code for that. And can it
    be done without animations Thanks
     
  2. randomperson42

    randomperson42

    Joined:
    Jun 29, 2013
    Posts:
    974
  3. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
  4. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    The point is that you look at the physics tutorials and others and learn to adapt it to your game. You will never find a specific tutorial for every possible thing and feature you want to do in your game.
     
  5. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
  6. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Normally I'd spam the heck outta the Learn section (everyone knows that about me LOL).

    But at least the issue which helps the sword going through wall is to give your sword a new Layer. Make a new Camera and change it to render only your new Layer and change the depth to higher than your main camera.

    (There are youtube videos) and google. I told you how, but if you need more help they can help your further lol.
     
    elmar1028 and Kiwasi like this.
  7. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Games are all about cheating. This method still let's you attack things through a wall. But that can be resolved too.
     
  8. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,147
    By cheating even more such as having walls be thick enough it doesn't matter! :p

    Or you could perform one or more ray casts to verify that there isn't an obstacle blocking your target. Especially if you wanted to support partial swings/obstacles.

    If the easy route works though, and your fans don't care about it, I would totally cheat away!
     
    Last edited: Mar 1, 2015
    Kiwasi likes this.
  9. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    I want to make the sword bounce when it hits the wall as it happens in dishonored
     
  10. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    I want the effect of sword being hit and bounced back
     
  11. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Bouncing effect is just an illusion. It's an animation like a sword being bounced from a surface.
     
    Ryiah likes this.
  12. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    The Idea i have is that i add force to the sword and rotate it for per second to create a swinging effect. then I can calculate the force from which the it hit the object and bounce it with its force set according to hit force. and I can use particle system for smoke and sparks. You know in mind of awesome people only awesome ideas come
     
  13. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    It's too complex for such a simple function. Making animation out of that would be much better and faster and won't damage performance.

    Yeah...only ideas
     
  14. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    But for special effect i don't see any other way. I know people r jealous from idea
     
  15. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,147
    Jealous of someone who has a simple game idea and no ability to pull it off themselves?
     
    Kresth2131, HemiMG, Stardog and 2 others like this.
  16. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Particles can be emitted using animation events. As well as other special effects.
     
  17. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    Hey I am a kid dont take me wrong
     
  18. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    I mean the bounce effect to stop the sword from going through walls
    xD
     
  19. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    When sword collides during "swing" animation ---> play "bounce off" animation
     
  20. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    This excuse is older than you.
     
    Last edited: Mar 3, 2015
    N1warhead likes this.
  21. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    HAhahahaahahaa
     
  22. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    I mean it
     
  23. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    kk. Y didn't this idea came to me???? because u talked to me that's y u also gave a ok idea
     
  24. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,147
    I was 12 when I sat down with the QuickBASIC reference manual and taught myself programming. It may seem daunting to start from the beginning, but imagine how it was for those of us who started prior to the existence of the Internet.
     
    elmar1028 likes this.
  25. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    OMG UNITY 5 OUT NOW
     
  26. knr_

    knr_

    Joined:
    Nov 17, 2012
    Posts:
    258
    You know, some of you folks are so hilarious. I wonder why it took me so long to swing by to the forums.
     
  27. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Yup. This is why forums were down for a while. BTW all Unity Pro features are available for FREE now.
     
  28. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    ALL PRO FEATURES IN FREE I DINT GET IT THERE IS BOTH A PERSONAL AND COMMERCIAL VERSION AND HOW WILL THEY MANAGE THIS MUCH LOSS
     
  29. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    Most FPS swords are not "physical". The swords rarely usually hit an enemy.

    To stop it going through walls they have a seperate camera for drawing the sword. The "hit" would be done with an invisible collider that activates at a certain point during the animation and "hits" whatever it touches.
     
  30. knr_

    knr_

    Joined:
    Nov 17, 2012
    Posts:
    258
    I wouldn't worry about it. I trust John & David. Just enjoy what you can now get for free and make your ideas come to life ;)
     
  31. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,147
    Every single engine is going to eventually go this route to some degree. Unreal 4 is free upfront with royalties, Unity 5 is free upfront but have to be bought past $100,000 annual revenue, Source 2 from Valve is free from what I heard, and Crytek is extremely cheap right now.

    Most likely they will approach the financial situation in the same way companies have been making money off of Linux for decades. By selling services, such as advanced support and automatic cloud builds, with Unity itself being practically free.
     
    Last edited: Mar 4, 2015
  32. Yash987654321

    Yash987654321

    Joined:
    Oct 22, 2014
    Posts:
    729
    Well If unity continues to make profit from new changed i will really be happy. I just gone crazy when I herd that all pro features r in free and I actually dont mind other things likr splash screen if we r making anything from anyone's hard work we can at least give them credit