Hi
This is a pretty specific issue - I'm using Anima2D to animate my characters, and using this tutorial (
https://www.youtube.com/watch?v=09To3ZCIZUY&t=1s) I'm able to change the skin/ costume for the characters.
The issue is, the method described in the tutorial allows you to change the skin by jumping on a collider. I have been doing it until now, but now I need it to be done through an action list. For this reason, creating a custom action that changes the skin would be required. I should also mention that I do not know how to code at all.
On
this page, the creator of the tutorial has described the functions/ variables his asset uses in order to change the skin.
Here is the code used in the collider that allows you to change skin by walking on the collider:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class skinchange : MonoBehaviour {
public string skinToLoad = "chris_skin1";
private void OnCollisionEnter2D(Collision2D collision)
{
SkinManager sm = collision.gameObject.GetComponent<SkinManager>();
if (sm == null || string.IsNullOrEmpty(skinToLoad)) return;
sm.LoadSkinByString(skinToLoad);
}
}
Here, "chris_skin1" is the skin I want to change to. How could this be done through an action list rather than by using a collider? I have of course read the tutorial on how to create custom actions, but I don't know what to write in it for this case as I don't have coding knowledge.
I realize helping me with this might be a big time investment as you might have to spend time understanding Anima2D as well, but I'm not sure where else to ask for help for specifically creating an AC custom action. Sorry if this is not the right place to ask the question! I would, of course, be happy to mention your name(s) in the credits for guiding me through this process.
Thank you!
Comments
This makes things so much better! Now I don't need to force the character to walk on skin change buttons anymore lol. Thanks!!