Search Unity

Question Creating Characters for an RPG

Discussion in 'Getting Started' started by jamezstrickland, Feb 14, 2024.

  1. jamezstrickland

    jamezstrickland

    Joined:
    Jul 3, 2017
    Posts:
    1
    I've watched many youtube videos about this but none have really helped me understand. If I wanted to work on a 2D RPG project in Unity, what is the best way to go about setting up characters? For example, if I'm making a 2D turn based combat RPG, and I want to generate characters with combat roles during runtime, (such as Fighter, Mage, Rogue) what is the best way to go about this? I know how to create a class of characters with their name, description, stats and the like, but if each character class had their own array of skills, where are those skills stored? Should each class of characters be a scriptable object? Or should each individual character be their own scriptable object? Should I make a prefab for each class and then add the specific character's details to that prefab after instantiation (such as name, sprite, etc)? How would you go about having each character reference the abilities that they should have access to? Should each individual skill be its own script? For example, if I wanted a fireball spell and a protection spell, should I have to make a separate script or scriptable object for each one? I would appreciate any advice and or references to videos, tutorials, or anything else that could teach me what I'm looking to learn. Thanks
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,735
    Sounds like the word "watched" might be the problem here. You need to understand them as well.

    If you didn't slow down to understand complete purpose-built tutorials, I am not sure anything scribbled here will be much help to you.

    Two steps to tutorials:

    1. do them perfectly, to the letter (zero typos, including punctuation and capitalization)
    2. stop and understand each step what is going on, otherwise you're just wasting time.

    Using your new-found two-step process to doing tutorials, here's some notes on ScriptableObjects in RPGs:

    ScriptableObject usage in RPGs:

    https://forum.unity.com/threads/scr...tiple-units-in-your-team.925409/#post-6055289

    https://forum.unity.com/threads/cre...ssigned-in-the-inspector.946240/#post-6174205
     
    Ryiah likes this.
  3. marcoantap

    marcoantap

    Joined:
    Sep 23, 2012
    Posts:
    229
    Or create a super class with every single skill and enable the ones corresponding to each character class.