Sorry if I ask too much but I figured this was worth a shot!

So I have an old gamemaker studio project that I want to do again but in unity and try it with ork,it was an action rpg with dungeon crawling elements,the game was topdown from a 2d perspective and the player had a basic melee weapon that would attack based on the direction he clicked from.

Currently I have all the movement and attack sprites as well as the weapon sprites and some enemies,I plan to use the top down camera and keep it static of course but my question comes from the following parts.

How would I do the attck system display the weapon when the attack is done and have it based on where the player clicks?,after having that set I should have everything else figured out by my own as I have been doing the tutorials and they have been pretty good as a learning tool for ORK
  • edited October 2022
    For displaying the weapon when the attack is done, I'd recommend a setup as in the 3D Action RPG tutorial series.
    I.e. use Equipment Viewer component on the player/combatant to show the weapon, but limit it to only display when defined conditions are valid, e.g. using a game state (see this part of the tutorial).
    Your attacks manage when the weapon is shown and hidden (via the conditions you defined) and do damage via damage dealers (unless you don't want to use actual physical hits for damaging. See this part of the tutorial.

    As for the weapon displaying in the correct direction - that depends on your overall player setup. E.g. I'd recommend a setup where your root player object is rotating in the movement direction (or e.g. toward the click) and a child object displays the actual player sprite (using a Face Camera component to always display correctly).
    That way you can e.g. just use a Rotate To node to rotate to the mouse position, and also drive your sprite directional animations via the rotation (can be forwarded in ORK's Mecanim animation setup to the animator controller).
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I actually was planning to use the 3D tutorial to set it up, with what you have told me now It seems I am going in the right direction thank you so much!
  • Alright I managed to do the player movement and everything seems to be going smooth,before I keep going and sorry once more if this question sounds dumb but is there a way I could have enemies "explode" into loot?,say when the player defeats one they usually toss their items around once they are defeated is that something one could do with templates?,I imagine I can make prefabs of every item and have ork spawn them on death based on what loot the player gets from the enemy
  • edited October 2022
    Also another small question,I got the attack schematic done,weapon shows up and the player can move,it hides and all,but how do I make it be in 2d?,I sadly cant seem to find a way to make the rotate to work on a 360 rotation around the player

    Edit:NVM found the option guess I was so focused on getting it all set up I forgot to tick it
    Post edited by Azrak12 on
  • Dead enemies can automatically drop their loot instead of adding it to the battle loot and collecting it with the loot dialogue. See the Battle Gains Collection settings in Battles > Battle End (or the individual battle system's optional override for this).

    The dropped loot is created based on the item prefabs you defined. The default prefab for all is set up in Inventory > Inventory Settings, each individual item, equipment, currency, etc. can define their own custom prefab.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Alright got it all working!,now time to do the hud and everything should be good to go from now on,thank you very much this is making it easier to port everything over!.

    Of course with unity and ork I can make everything way fancier so I am excited to finish this project
  • Hey so I finally am almost having everything imported and I got the animations all done,but now I face a problem,my player has only one idle sprite "facing the player" that all works and he can move and all but whenever I press any movement key he slides on the ground before it changes to the movement animation,is there a way I could make it more...snappy or say instant?
  • Depends on your setup :)
    Might be the animation itself, e.g. starting with an 'idle' frame in the movement animation instead of starting with a 'step' frame.
    Might be animator controller (if you're using Mecanim) using exit times for the transitions, so the movement animation waits for the previous to finish, etc.

    Could be different things - which player controls are you using, how's your animation setup, etc.?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I am using Mecanim but now that you mention the exit part and the Idle frame im going to take a loot at that too,seems like that might be whats causing the problem
  • A quick update and maybe tip on the project,I made the player have a base "weapon" empty object and that one has a child that is actually the equipment displayer,that way the movement of the player doesnt gets all wonky once it rotates to show the attack being done
  • Changing the 2D tutorial's combatant prefab setup is on my todo list. The current one is too complicated and using rotating into movement direction and a child sprite facing the camera is the easier solution :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Currently my problem now is mostly getting the enemy to also move without it becoming too wonky on its own using the AI but I have been making some progress, my only question for now is if there is a way for the attack to be animated as in not the player but the "attack" Sprite lets say showing the weapon swing.

    For example the player attacks to the uper left, the weapon object shows in the upper left as an Animation that has the hitbox and everything added pretty much the curren setup I have I only need a way to play the "swing" animations to show the damage area
  • Well, sure - you can use a Play Mecanim Animation node (or Play Legacy Animation node if you're using legacy animations) to play an animation on your weapon.
    Naturally, your weapon prefabs have to be set up for that.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • So I have been making progress!, but now I am once again stuck.

    Finally everything is working together as intended except for one detail I cant seem to figure and that is my enemy wont play its move animstion.

    He is pretty much a copy of the player prefab and uses its own Animation, but for some reason even when moving he stays idle, at times the movement Animation seems to flash as if it was trying to show itself.

    When using the inspector the enemy speed constantly goes up and down all the way to 0,of course I am working on 2D.

    Another thing is that I set one move Animation for all the movement direction since I have the enemy also able to look where its moving so thats whats not playing at all.

    I could try later to share some pictures of the set up if that helps since its really giving me Some trouble
  • If the combatant's movement animations are played based on the movement speed, e.g. forwarded via the Mecanim animation setup to the animator controller, it's critical to have the correct movement setup.

    How's the combatant moved and what Update Mode is set for the used prefab?
    In short - when moving via rigidbody, the update mode should be set to Fixed Update since the movement speed has to be determined in the physics frame.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.