Forum begins after the advertisement:
Character Selector Different Skins
Home › Forums › Video Game Tutorial Series › Creating a Rogue-like Shoot-em Up in Unity › Character Selector Different Skins
- This topic has 10 replies, 6 voices, and was last updated 2 years ago by
g Dni.
-
AuthorPosts
-
August 22, 2023 at 9:53 pm #11802::
Hello,
I have 2 different characters that look different but your character selector only implements the scriptable object. How can I make the characters also look different with animations etc not just the stats?
August 23, 2023 at 12:19 am #11806::I’m not very clear about the inner workings of the Vampire Survivors series’ codebase, but generally speaking, if you want different animations for another character, you will have to create a different Animator Controller for the other character and prefab it.
Let me know if that makes sense.
August 23, 2023 at 2:09 pm #11809::Hi Jeremy Lock, that’s an interesting question.
It sounds to me that you want the sprite and animator controller to be different depending on which character is selected. This is a relatively straightforward process.
- First, you have to add a sprite and animator controller fields to the
CharacterScriptableObject - Then, when assigning the data in the
PlayerStats, simply change the sprite and animator controller to that of thecharacterData‘s
Hope this helps!
August 29, 2023 at 6:56 pm #11866::Hi Xavier Lee im currently having a problem with the second step of assigning the data to the PlayerStats script, could you send me a picture of the code?
August 30, 2023 at 10:22 pm #11868::Hi Windfinz, we post all our codes in the accompanying articles for each video. You can find a list of all the articles here: https://blog.terresquall.com/series/creating-a-rogue-like-vampire-survivors/
September 26, 2023 at 12:31 pm #11951October 30, 2023 at 12:16 pm #12135::Hi Xavier Lee I have the same question. I make the prefabs of characters with different sprite and animation. Then i add the GameObject field of characters’ prefab to the characterScriptableObject. But it doesn’t work.
October 30, 2023 at 4:21 pm #12137October 31, 2023 at 11:11 am #12140::<code> void Awake() { ...... currentSprite = characterData.Sprite; currentAnimatorController = characterData.AnimatorController; } void Start() { //Done transform.GetComponent<Animator>().runtimeAnimatorController = currentAnimatorController; Debug.Log("currentAnimatorController: " + currentAnimatorController); //not work transform.GetComponent<SpriteRenderer>().sprite = currentSprite; Debug.Log("sprite: " + currentSprite); } </code>I followed the suggestions. It wokrs for changing animator, but not for sprite.
October 31, 2023 at 8:57 pm #12141November 4, 2023 at 11:00 am #12153 - First, you have to add a sprite and animator controller fields to the
-
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: